summaryrefslogtreecommitdiffstats
path: root/perl-install/bootloader.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-04-05 19:47:29 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-04-05 19:47:29 +0000
commit988d35d5ae31c17c2e131d45edea5b8577706563 (patch)
tree9ca9ed4a3f0527ec440b4cb2a3c9d4af9441de2b /perl-install/bootloader.pm
parent1966dd865a5daa8c93a9ee98b7c3f1af8b4081ec (diff)
downloaddrakx-backup-do-not-use-988d35d5ae31c17c2e131d45edea5b8577706563.tar
drakx-backup-do-not-use-988d35d5ae31c17c2e131d45edea5b8577706563.tar.gz
drakx-backup-do-not-use-988d35d5ae31c17c2e131d45edea5b8577706563.tar.bz2
drakx-backup-do-not-use-988d35d5ae31c17c2e131d45edea5b8577706563.tar.xz
drakx-backup-do-not-use-988d35d5ae31c17c2e131d45edea5b8577706563.zip
(install_lilo): fix lilo's dumbness (when lilo warns about not the first drive, it usually fails)
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r--perl-install/bootloader.pm24
1 files changed, 17 insertions, 7 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 7add5f1c6..55b64018d 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -253,8 +253,6 @@ sub suggest {
timeout => $onmbr && 5,
install => "/boot/boot.b",
});
-#- the following is not needed anymore with latest lilo
-#- $lilo->{disk} ||= "/dev/$hds->[0]{device} bios=0x80" if $hds->[0]{device} =~ /^hd[be]$/;
if (!$lilo->{message} || $lilo->{message} eq "1") {
$lilo->{message} = join('', cat_("$prefix/boot/message"));
@@ -588,7 +586,7 @@ sub install_silo($$$) {
}
sub install_lilo($$) {
- my ($prefix, $lilo) = @_;
+ my ($prefix, $lilo, $fstab, $hds) = @_;
$lilo->{prompt} = $lilo->{timeout};
if ($lilo->{message}) {
@@ -602,10 +600,21 @@ sub install_lilo($$) {
open F, ">$f" or die "cannot create lilo config file: $f";
log::l("writing lilo config to $f");
- $lilo->{$_} and print F "$_=$lilo->{$_}" foreach qw(boot map install vga default append keytable disk);
+ $lilo->{$_} and print F "$_=$lilo->{$_}" foreach qw(boot map install vga default append keytable);
$lilo->{$_} and print F $_ foreach qw(linear lba32 compact prompt restricted);
#- print F "password=", $lilo->{password} if $lilo->{restricted} && $lilo->{password}; #- done by msec
print F "timeout=", round(10 * $lilo->{timeout}) if $lilo->{timeout};
+
+ my $dev = $hds->[0]{device};
+ my %dev2bios = map_index { $_ => $::i } dev2bios($hds, $lilo->{boot});
+ if ($dev2bios{$dev}) {
+ my %bios2dev = reverse %dev2bios;
+ print F "disk=/dev/$bios2dev{0} bios=0x80";
+ printf F "disk=/dev/$dev bios=0x%x", 0x80 + $dev2bios{$dev};
+ } elsif ($dev =~ /hd[bde]/) {
+ print F "disk=/dev/$dev bios=0x80";
+ }
+
if ($lilo->{message}) {
if (-e "$prefix/boot/$lilo->{methods}{lilo}" && $lilo->{methods}{lilo} eq "boot-graphic.b") {
print F "message=/boot/message-graphic";
@@ -672,8 +681,7 @@ sub dev2bios {
s/x(d.)/h$1/ foreach @dev; #- switch back;
- (map_index { $_ => "fd$::i" } detect_devices::floppies()),
- (map_index { $_ => "hd$::i" } @dev);
+ @dev;
}
sub dev2grub {
@@ -685,7 +693,9 @@ sub dev2grub {
sub install_grub {
my ($prefix, $lilo, $fstab, $hds) = @_;
- my %dev2bios = dev2bios($hds, $lilo->{boot});
+ my %dev2bios =
+ (map_index { $_ => "fd$::i" } detect_devices::floppies()),
+ (map_index { $_ => "hd$::i" } dev2bios($hds, $lilo->{boot}));
{
my %bios2dev = reverse %dev2bios;