From 08beb3710539ff52ec2fdc31d32e48a056298366 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 12 Jul 2004 02:28:16 +0000 Subject: (sort_hds_according_to_bios): when installing on floppy, $boot_hd is undefined, but that's ok (bugzilla #10260) --- perl-install/bootloader.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'perl-install/bootloader.pm') diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 7c8f5eb8d..df12c227a 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -1048,13 +1048,13 @@ sub mixed_kind_of_disks { sub sort_hds_according_to_bios { my ($bootloader, $hds) = @_; - my $boot_hd = fs::device2part($bootloader->{first_hd_device} || $bootloader->{boot}, $hds) or die "sort_hds_according_to_bios: unknown hd"; #- if not on mbr - my $boot_kind = hd2bios_kind($boot_hd); + my $boot_hd = fs::device2part($bootloader->{first_hd_device} || $bootloader->{boot}, $hds); #- $boot_hd is undefined when installing on floppy + my $boot_kind = $boot_hd && hd2bios_kind($boot_hd); my $translate = sub { my ($hd) = @_; my $kind = hd2bios_kind($hd); - ($hd == $boot_hd ? 0 : $kind eq $boot_kind ? 1 : 2) . "_$kind"; + $boot_hd ? ($hd == $boot_hd ? 0 : $kind eq $boot_kind ? 1 : 2) . "_$kind" : $kind; }; sort { $translate->($a) cmp $translate->($b) } @$hds; } -- cgit v1.2.1