diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2005-06-17 09:14:08 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2005-06-17 09:14:08 +0000 |
commit | 2e09e8695c6fe27cb95aca366aecaf18517731ac (patch) | |
tree | 8dcab4f7395f448b13baa26bfb0b212c95b2c3db /perl-install | |
parent | b236fd6fd4a3667c6032bf2e52b3b4fea954302b (diff) | |
download | drakx-2e09e8695c6fe27cb95aca366aecaf18517731ac.tar drakx-2e09e8695c6fe27cb95aca366aecaf18517731ac.tar.gz drakx-2e09e8695c6fe27cb95aca366aecaf18517731ac.tar.bz2 drakx-2e09e8695c6fe27cb95aca366aecaf18517731ac.tar.xz drakx-2e09e8695c6fe27cb95aca366aecaf18517731ac.zip |
(write_lilo) fix support for labels (eg: when switching from GRUB to
LILO, let's prevent unmanagable 'root="LABEL=..."' to appear)
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/bootloader.pm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 67ab14c00..dc59b1047 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -1086,9 +1086,10 @@ sub write_lilo { push @conf, "# File generated by DrakX/drakboot"; push @conf, "# WARNING: do not forget to run lilo after modifying this file\n"; push @conf, "default=" . make_label_lilo_compatible($bootloader->{default}) if $bootloader->{default}; - push @conf, map { $_ . '=' . $quotes_if_needed->($bootloader->{$_}) } grep { $bootloader->{$_} } qw(boot root map install vga keytable raid-extra-boot menu-scheme); + my $root_uses_label = $bootloader->{root} =~ /^LABEL=/; + push @conf, map { $_ . '=' . $quotes_if_needed->($bootloader->{$_}) } grep { $bootloader->{$_} } qw(boot map install vga keytable raid-extra-boot menu-scheme), if_(!$root_uses_label, 'root'); push @conf, grep { $bootloader->{$_} } qw(linear geometric compact prompt nowarn restricted static-bios-codes); - push @conf, qq(append="$bootloader->{append}") if $bootloader->{append}; + push @conf, qq(append="$bootloader->{append}), if_($root_uses_label, "root=$bootloader->{root}"), '"' if $bootloader->{append} || $root_uses_label; push @conf, "password=" . $bootloader->{password} if $bootloader->{password}; #- also done by msec push @conf, "timeout=" . round(10 * $bootloader->{timeout}) if $bootloader->{timeout}; push @conf, "serial=" . $1 if get_append_with_key($bootloader, 'console') =~ /ttyS(.*)/; @@ -1105,9 +1106,10 @@ sub write_lilo { push @entry_conf, "label=" . make_label_lilo_compatible($entry->{label}) if $entry->{label}; if ($entry->{type} eq "image") { - push @entry_conf, 'root=' . $quotes_if_needed->($entry->{root}) if $entry->{root}; + my $entry_root_uses_label = $entry->{root} =~ /^LABEL=/; + push @entry_conf, 'root=' . $quotes_if_needed->($entry->{root}) if $entry->{root} && !$entry_root_uses_label; push @entry_conf, "initrd=" . $file2fullname->($entry->{initrd}) if $entry->{initrd}; - push @entry_conf, qq(append="$entry->{append}") if $entry->{append}; + push @entry_conf, join('', qq(append="$entry->{append}), if_($entry_root_uses_label, "root=$entry->{root}"), '"') if $entry->{append} || $entry->{root}; push @entry_conf, "vga=$entry->{vga}" if $entry->{vga}; push @entry_conf, grep { $entry->{$_} } qw(read-write read-only optional); } else { |