From 42a3552c85e5bb47fb22afc9ab120a60cd3ea4e7 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 13 Aug 2012 10:35:31 +0000 Subject: (mkinitrd) do not crash if a foreign partition is not mounted (mga#6966) (backported from trunk) --- perl-install/NEWS | 1 + perl-install/bootloader.pm | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/perl-install/NEWS b/perl-install/NEWS index 4b707de47..e21048b2d 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -4,6 +4,7 @@ - drakauth: don't update UsePAM option in sshd configuration - drakboot: o do not crash if trying to build initrd from unknown partitions (mga#4290) + o do not crash if a foreign partition is not mounted (mga#6966) o install acpi & acpid at once - drakxservices: o when listing services ensure disabled services that can be enabled are diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index fedb4a15e..62a046fe9 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -109,9 +109,11 @@ sub get_label { sub mkinitrd { my ($kernel_version, $bootloader, $entry, $initrd) = @_; + my $dir = dirname($initrd); return $initrd if $::testing # testing mode || -e "$::prefix/$initrd" # already exists - || $initrd =~ /\(hd/; # unrecognized partition + || $initrd =~ /\(hd/ # unrecognized partition + || !-d $dir; # dir doesn't exist (probably !mounted foreign part) # for /boot on dos partitions when installing on loopback file on dos partition my $loop_boot = fs::loopback::prepare_boot(); -- cgit v1.2.1