summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2005-09-05 14:25:31 +0000
committerAntoine Ginies <aginies@mandriva.com>2005-09-05 14:25:31 +0000
commit6a1aced5d62a6754ef134821a3663cccd46963c8 (patch)
tree445bec74b4fbaaf729517fd9c29cbf9ce769d50c
parentd9cf2a08c99412333327c304956868a7ed9b0e70 (diff)
downloaddrakpxelinux-6a1aced5d62a6754ef134821a3663cccd46963c8.tar
drakpxelinux-6a1aced5d62a6754ef134821a3663cccd46963c8.tar.gz
drakpxelinux-6a1aced5d62a6754ef134821a3663cccd46963c8.tar.bz2
drakpxelinux-6a1aced5d62a6754ef134821a3663cccd46963c8.tar.xz
drakpxelinux-6a1aced5d62a6754ef134821a3663cccd46963c8.zip
fix default boot for each profile
-rw-r--r--drakpxelinux.pl18
1 files changed, 11 insertions, 7 deletions
diff --git a/drakpxelinux.pl b/drakpxelinux.pl
index ea81c55..3f0fa50 100644
--- a/drakpxelinux.pl
+++ b/drakpxelinux.pl
@@ -64,6 +64,7 @@ network::network::read_net_conf($net);
my $sys_wizard_pxe = "/etc/sysconfig/drak_pxe";
my ($interface) = cat_($sys_wizard_pxe) =~ /INTERFACE=(.*)/;
$interface ||= $net->{net_interface};
+link_default_path();
my $help = "" .
N("PXE Label: the name to be displayed in the PXE menu (an ASCII word/number)") . "\n" .
@@ -942,7 +943,7 @@ sub create_profiles_list() {
$profiles->get_selection->set_mode('browse');
$profiles->get_selection->signal_connect(changed => sub {
my $pxelinux_conf = get_pxelinux_conf_from_profile();
- #refresh_menu($pxelinux_conf, $treeview);
+ refresh_menu();
update_treeview($pxelinux_conf);
});
return $profiles;
@@ -1050,8 +1051,8 @@ sub refresh_profiles() {
@{$profiles->{data}} = @profiles;
}
-sub refresh_menu {
- my ($pxelinux_conf, $treeview) = @_;
+sub refresh_menu() {
+ my $pxelinux_conf = get_pxelinux_conf_from_profile();
my @menu = network::pxe::list_pxelinux_labels($pxelinux_conf);
mygtk2::gtkset($menu_combo, list => [ '', @menu ]);
my $defaultlabel = $pxelinux_conf->{default};
@@ -1062,9 +1063,13 @@ sub refresh_menu {
} else { $c++ }
}
$menu_combo->signal_connect(changed => sub {
- #my $pxelinux_conf = get_selected_profile;
- $pxelinux_conf->{default} = $menu_combo->get_active_text;
- $pxelinux_conf and write_conf($pxelinux_conf, $treeview);
+ my $model_profiles = $profiles->get_model;
+ my $iter = $profiles->get_selection->get_selected;
+ ($config_file, $help_file) = network::pxe::get_pxelinux_profile_path($model_profiles->get($iter, 0), 'boot');
+ my $new_default = $menu_combo->get_active_text;
+ substInFile {
+ s/DEFAULT.*/DEFAULT $new_default/;
+ } $config_file;
});
}
@@ -1288,7 +1293,6 @@ gtkpack($w->{window}, gtknew('VBox', spacing => 0, children => [
);
add_local_profil_entry();
-link_default_path();
add_configured_mac_addresses();
get_mac_addresses_from_dhcp_log();
update_systems_data_from_file();