From 9913417701c7ad7d776c117453a3c5ea6421ac17 Mon Sep 17 00:00:00 2001 From: Antoine Ginies Date: Wed, 14 Sep 2005 10:54:25 +0000 Subject: add auto_install option --- drakpxelinux.pl | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drakpxelinux.pl b/drakpxelinux.pl index 437e2a1..287c65e 100644 --- a/drakpxelinux.pl +++ b/drakpxelinux.pl @@ -165,7 +165,8 @@ use constant COLUMN_RAMDISK => 9; use constant COLUMN_VGA => 10; use constant COLUMN_DISPLAY => 11; use constant COLUMN_OPTION => 12; -use constant NUM_COLUMNS => 13; +use constant COLUMN_KICKSTART => 13; +use constant NUM_COLUMNS => 14; my ($profile, $type); foreach (@ARGV) { @@ -198,7 +199,7 @@ sub update_pxelinux_conf_from_treeview { my $iter = $model->get_iter_first; splice @{$pxelinux_conf->{entries}}; while ($iter) { - my ($label, $info, $kernel, $initrd, $method, $interface, $network, $server, $directory, $ramdisk, $vga, $display, $option) = $model->get($iter, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12); + my ($label, $info, $kernel, $initrd, $method, $interface, $network, $server, $directory, $ramdisk, $vga, $display, $option, $kickstart) = $model->get($iter, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13); my $entry = { label => $label, info => $info, @@ -213,6 +214,7 @@ sub update_pxelinux_conf_from_treeview { vga => $network::pxe::vga_resolution_to_bios{$vga}, display => $display, option => $option, + kickstart => $kickstart, }; push @{$pxelinux_conf->{entries}}, $entry; $iter = $model->iter_next($iter); @@ -246,13 +248,14 @@ sub set_pxelinux_entry_at_iter { COLUMN_VGA, $network::pxe::vga_bios_to_resolution{$entry->{vga}}, COLUMN_DISPLAY, $entry->{display}, COLUMN_OPTION, $entry->{option}, + COLUMN_KICKSTART, $entry->{kickstart}, ); } sub create_model() { # my $model = Gtk2::ListStore->new(("Glib::String") x NUM_COLUMNS); - my $model = Gtk2::ListStore->new("Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String"); + my $model = Gtk2::ListStore->new("Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String", "Glib::String"); # set_pxelinux_entry_at_iter($model, $model->append, $_) foreach @{$pxelinux_conf->{entries}}; set_pxelinux_entry_at_iter($model, $model->append, $_) foreach @{$pxelinux_conf->{entries}}; return $model; @@ -521,6 +524,9 @@ sub edit_box_item { $initrd->set_text($entry->{initrd}); set_help_tip($initrd, 'initrd'); + my $kickstart = Gtk2::Entry->new; + $kickstart->set_text($entry->{kickstart}); + my $file_dialog = $fdwidget->($initrd, "", "initrd", $entry->{label}); my $buttoninitrd = Gtk2::Button->new(N("Select associated initrd")); $buttoninitrd->signal_connect(clicked => sub { $file_dialog->show }); @@ -608,7 +614,7 @@ sub edit_box_item { 0, gtkadd(Gtk2::Frame->new(N("PXE entry")), gtkpack_(gtkset_border_width(Gtk2::VBox->new, 5), 0, $label_and_widgets->(N("Label"), $label, ""), - #0, $label_and_widgets->(N("Entry description"), $info, ""), + 0, $label_and_widgets->(N("Entry description"), $info, ""), 0, Gtk2::VSeparator->new, 0, $label_and_widgets->(N("Kernel image: ") . $network::pxe::pxelinux_client_root . "/", $kernel, $buttonkernel), 0, $label_and_widgets->(N("Initrd image: ") . $network::pxe::pxelinux_client_root . "/", $initrd, $buttoninitrd), @@ -631,6 +637,7 @@ sub edit_box_item { 2, gtkadd_widget($size_groups{button}, ""), ), 0, $label_and_widgets->(N("Remote server name"), $server, ""), + 0, $label_and_widgets->("auto_install", $kickstart, ""), 0, $label_and_widgets->(N("Remote installation directory"), $directory, ""), ), ), @@ -661,6 +668,7 @@ sub edit_box_item { $entry->{vga} = $network::pxe::vga_resolution_to_bios{$vga->entry->get_text}; $entry->{display} = $display->get_text; $entry->{option} = $option->get_text; + $entry->{kickstart} = $kickstart->get_text; # update value in cells set_pxelinux_entry_at_iter($model, $iter, $entry); @@ -832,7 +840,7 @@ sub add_columns { $renderer->set(editable => 0); $renderer->set_data(column => $::i); $treeview->insert_column_with_attributes(-1, $_, $renderer, 'text' => $::i); - } N("Label"), N("Entry description"), N("Kernel image"), N("Initrd image"), N("Installation method"), N("Network interface"), N("DHCP or IP address"), N("Remote server name"), N("Remote installation directory"), N("Ramdisk size"), N("Frame buffer resolution"), N("Remote IP of X server"), N("Custom options"); + } N("Label"), N("Entry description"), N("Kernel image"), N("Initrd image"), N("Installation method"), N("Network interface"), N("DHCP or IP address"), N("Remote server name"), N("Remote installation directory"), N("Ramdisk size"), N("Frame buffer resolution"), N("Remote IP of X server"), N("Custom options"), "Auto_install"; } -- cgit v1.2.1