diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-07-05 02:23:37 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-07-05 02:23:37 +0000 |
commit | 1ebb964fd5969adc53f26f5b8a12a728fc3027cf (patch) | |
tree | 7439a97d6cd5ba2756e0f4979c2c1131256da537 | |
parent | b6c3cec5e4422274a243e582c7725d62f0441297 (diff) | |
download | drakx-1ebb964fd5969adc53f26f5b8a12a728fc3027cf.tar drakx-1ebb964fd5969adc53f26f5b8a12a728fc3027cf.tar.gz drakx-1ebb964fd5969adc53f26f5b8a12a728fc3027cf.tar.bz2 drakx-1ebb964fd5969adc53f26f5b8a12a728fc3027cf.tar.xz drakx-1ebb964fd5969adc53f26f5b8a12a728fc3027cf.zip |
drop "other" entries in grub conf when the device is unknown
-rw-r--r-- | perl-install/bootloader.pm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index e0cc41c2a..db9030ad1 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -1140,11 +1140,11 @@ sub write_grub { }; foreach (@{$bootloader->{entries}}) { - push @conf, "\ntitle $_->{label}"; + my $title = "\ntitle $_->{label}"; if ($_->{type} eq "image") { my $vga = $_->{vga} || $bootloader->{vga}; - push @conf, + push @conf, $title, join(' ', 'kernel', $file2grub->($_->{kernel_or_dev}), if_($_->{root}, $_->{root} =~ /loop7/ ? "root=707" : "root=$_->{root}"), #- special to workaround bug in kernel (see #ifdef CONFIG_BLK_DEV_LOOP) $_->{append}, @@ -1152,7 +1152,12 @@ sub write_grub { if_($vga && $vga ne "normal", "vga=$vga")); push @conf, "initrd " . $file2grub->($_->{initrd}) if $_->{initrd}; } else { - push @conf, "root " . device_string2grub($_->{kernel_or_dev}, \@legacy_floppies, \@sorted_hds); + my $dev = eval { device_string2grub($_->{kernel_or_dev}, \@legacy_floppies, \@sorted_hds) }; + if (!$dev) { + log::l("dropping bad entry $_->{label} for unknown device $_->{kernel_or_dev}"); + next; + } + push @conf, $title, "root $dev"; if ($_->{table}) { if (my $hd = fs::device2part($_->{table}, \@sorted_hds)) { |