summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-08-13 09:09:30 +0000
committerOlivier Blin <oblin@mandriva.org>2004-08-13 09:09:30 +0000
commit12fa31981994b32339f83de33ac82364c382c4c5 (patch)
tree7a3fea641160e34773c0192100412fe26adeb141
parentb3c2a9a5d15aaaf933677b7c4369e6dce255856c (diff)
downloaddrakx-12fa31981994b32339f83de33ac82364c382c4c5.tar
drakx-12fa31981994b32339f83de33ac82364c382c4c5.tar.gz
drakx-12fa31981994b32339f83de33ac82364c382c4c5.tar.bz2
drakx-12fa31981994b32339f83de33ac82364c382c4c5.tar.xz
drakx-12fa31981994b32339f83de33ac82364c382c4c5.zip
add and use bootloader::set_append_netprofile() and bootloader::get_append_netprofile()
-rw-r--r--perl-install/any.pm6
-rw-r--r--perl-install/bootloader.pm13
2 files changed, 16 insertions, 3 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 199fe3ee0..7e39a424e 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -285,14 +285,14 @@ sub setupBootloader__entries {
my ($e) = @_;
my $default = my $old_default = $e->{label} eq $b->{default};
my $vga = Xconfig::resolution_and_depth::from_bios($e->{vga});
- my $netprofile = bootloader::get_append($b, 'PROFILE');
+ my ($append, $netprofile) = bootloader::get_append_netprofile($e);
my @l;
if ($e->{type} eq "image") {
@l = (
{ label => N("Image"), val => \$e->{kernel_or_dev}, list => [ map { "/boot/$_" } bootloader::installed_vmlinuz() ], not_edit => 0 },
{ label => N("Root"), val => \$e->{root}, list => [ map { "/dev/$_->{device}" } @$fstab ], not_edit => !$::expert },
-{ label => N("Append"), val => \$e->{append} },
+{ label => N("Append"), val => \$append },
if_(arch() !~ /ppc|ia64/,
{ label => N("Video mode"), val => \$vga, list => [ '', Xconfig::resolution_and_depth::bios_vga_modes() ], format => \&Xconfig::resolution_and_depth::to_string, advanced => 1 },
),
@@ -336,7 +336,7 @@ sub setupBootloader__entries {
$b->{default} = $old_default || $default ? $default && $e->{label} : $b->{default};
$e->{vga} = ref($vga) ? $vga->{bios} : $vga;
- bootloader::set_append($b, PROFILE => $netprofile);
+ bootloader::set_append_netprofile($e, $append, $netprofile);
bootloader::configure_entry($e); #- hack to make sure initrd file are built.
1;
};
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 7defe84da..c2a7f29ce 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -538,6 +538,19 @@ sub may_append {
set_append($b, $key, $val) if !get_append($b, $key);
}
+sub get_append_netprofile {
+ my ($e) = @_;
+ my ($simple, $dict) = unpack_append($e->{append});
+ my ($p, $dict_) = partition { $_->[0] eq 'PROFILE' } @$dict;
+ pack_append($simple, $dict_), $p->[0][1];
+}
+sub set_append_netprofile {
+ my ($e, $append, $profile) = @_;
+ my ($simple, $dict) = unpack_append($append);
+ push @$dict, [ 'PROFILE', $profile ] if $profile;
+ $e->{append} = pack_append($simple, $dict);
+}
+
sub configure_entry {
my ($entry) = @_;
$entry->{type} eq 'image' or return;