diff options
-rw-r--r-- | perl-install/bootloader.pm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index d64d6d118..c4528656f 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -1056,9 +1056,11 @@ 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 { "$_=$bootloader->{$_}" } grep { $bootloader->{$_} } qw(boot root map install vga keytable raid-extra-boot); + my $root_uses_label = $bootloader->{root} =~ /$LABEL=/; + push @conf, map { "$_=$bootloader->{$_}" } grep { $bootloader->{$_} } qw(boot map install vga keytable raid-extra-boot), + 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(.*)/; @@ -1076,9 +1078,10 @@ sub write_lilo { push @entry_conf, "label=" . make_label_lilo_compatible($entry->{label}); if ($entry->{type} eq "image") { - push @entry_conf, "root=$entry->{root}" if $entry->{root}; + my $entry_root_uses_label = $entry->{root} =~ /$LABEL=/; + push @entry_conf, "root=$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, $entry->{'read-write'} ? "read-write" : "read-only"; push @entry_conf, grep { $entry->{$_} } qw(optional); |