From 8ab7c2b12580f5b0dcbce058119991d8778d69b0 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 9 Apr 2001 10:33:34 +0000 Subject: (install_lilo): better handling of map-drive (there's not always only 2 disks!) --- perl-install/bootloader.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'perl-install/bootloader.pm') diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index cfa2dcc47..f152e4be1 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -642,10 +642,13 @@ sub install_lilo($$) { print F "\ttable=$_->{table}" if $_->{table}; print F "\tunsafe" if $_->{unsafe} && !$_->{table}; - #- boot off the second drive, so reverse the BIOS maps - $_->{mapdrive} ||= { '0x80' => '0x81', '0x81' => '0x80' } - if $_->{table} && $lilo->{boot} !~ /$_->{table}/; - + if (my ($dev) = $_->{table} =~ m|/dev/(.*)|) { + if ($dev2bios{$dev}) { + #- boot off the nth drive, so reverse the BIOS maps + my $nb = sprintf("0x%x", 0x80 + $dev2bios{$dev}); + $_->{mapdrive} ||= { '0x80' => $nb, $nb => '0x80' }; + } + } while (my ($from, $to) = each %{$_->{mapdrive} || {}}) { print F "\tmap-drive=$from"; print F "\t to=$to"; -- cgit v1.2.1