summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-02-27 19:34:23 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-02-27 19:34:23 +0000
commit5f05559584f8d23c6e79b4ab197ba67ff6f43f49 (patch)
tree4fdab437b2cc24455a6e2be009bcea4b799f261e
parentb0278853f4ba4296e954241bd3cbed3302d0b0d5 (diff)
downloaddrakx-backup-do-not-use-5f05559584f8d23c6e79b4ab197ba67ff6f43f49.tar
drakx-backup-do-not-use-5f05559584f8d23c6e79b4ab197ba67ff6f43f49.tar.gz
drakx-backup-do-not-use-5f05559584f8d23c6e79b4ab197ba67ff6f43f49.tar.bz2
drakx-backup-do-not-use-5f05559584f8d23c6e79b4ab197ba67ff6f43f49.tar.xz
drakx-backup-do-not-use-5f05559584f8d23c6e79b4ab197ba67ff6f43f49.zip
use lilo-like code for selecting mapdrive or not
(it was buggy, always generating "map (0x81) (0x80)", even for hd2)
-rw-r--r--perl-install/bootloader.pm15
1 files changed, 9 insertions, 6 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index c60e84f77..2181b5b6c 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -1014,13 +1014,16 @@ sub write_grub_config {
print F "initrd ", $file2grub->($_->{initrd}) if $_->{initrd};
} else {
print F "root ", dev2grub($_->{kernel_or_dev}, \%dev2bios);
- if ($_->{kernel_or_dev} !~ /fd/) {
- #- boot off the second drive, so reverse the BIOS maps
- $_->{mapdrive} ||= { '0x80' => '0x81', '0x81' => '0x80' }
- if $_->{table} && ($bootloader->{first_hd_device} || $bootloader->{boot}) !~ /$_->{table}/;
-
- map_each { print F "map ($::b) ($::a)" } %{$_->{mapdrive} || {}};
+ if (my ($dev) = $_->{table} =~ m|/dev/(.*)|) {
+ if ($dev2bios{$dev} =~ /hd([1-9])/) {
+ #- boot off the nth drive, so reverse the BIOS maps
+ my $nb = sprintf("0x%x", 0x80 + $1);
+ $_->{mapdrive} ||= { '0x80' => $nb, $nb => '0x80' };
+ }
+ }
+ if ($_->{mapdrive}) {
+ map_each { print F "map ($::b) ($::a)" } %{$_->{mapdrive}};
print F "makeactive";
}
print F "chainloader +1";