diff options
-rw-r--r-- | perl-install/NEWS | 3 | ||||
-rw-r--r-- | perl-install/bootloader.pm | 15 |
2 files changed, 14 insertions, 4 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS index d4b1880c6..7a1b5bd37 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,6 +1,9 @@ - diskdrake: o handle md devices not called md\d+, like md_d127 o display an error when mount fails during View action +- bootloader: + o keep grub entries which refer to unknown devices verbatim instead + of crashing (#48728) Version 12.27 - 14 April 2009 diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index c816baed6..b6dcb9770 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -335,9 +335,16 @@ sub read_grub_menu_lst { #- sanitize foreach my $e (@{$b{entries}}) { if (member($e->{type}, 'other', 'grub_configfile')) { - $e->{kernel_or_dev} = grub2dev($e->{rootnoverify} || $e->{grub_root}, $grub2dev); + eval { $e->{kernel_or_dev} = grub2dev($e->{rootnoverify} || $e->{grub_root}, $grub2dev); } + $e->{keep_verbatim} = 1 unless $e->{kernel_or_dev}; } elsif ($e->{initrd}) { - $e->{initrd} = grub2file($e->{initrd}, $grub2dev, $fstab, $e); + my $initrd; + eval { $initrd = grub2file($e->{initrd}, $grub2dev, $fstab, $e)}; + if ($initrd) { + $e->{initrd} = $initrd; + } else { + $e->{keep_verbatim} = 1; + } } if ($e->{kernel} =~ /xen/ && @{$e->{modules} || []} == 2 && $e->{modules}[1] =~ /initrd/) { @@ -350,8 +357,8 @@ sub read_grub_menu_lst { (my $kernel, $e->{append}) = split(' ', $v, 2); $e->{append} = join(' ', grep { !/^BOOT_IMAGE=/ } split(' ', $e->{append})); $e->{root} = $1 if $e->{append} =~ s/root=(\S*)\s*//; - $e->{kernel_or_dev} = grub2file($kernel, $grub2dev, $fstab, $e); - $e->{keep_verbatim} = 1 if dirname($e->{kernel_or_dev}) ne '/boot'; + eval { $e->{kernel_or_dev} = grub2file($kernel, $grub2dev, $fstab, $e) }; + $e->{keep_verbatim} = 1 unless $e->{kernel_or_dev} && dirname($e->{kernel_or_dev}) eq '/boot'; } my ($vga, $other) = partition { /^vga=/ } split(' ', $e->{append}); if (@$vga) { |