summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-03-20 14:40:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-03-20 14:40:16 +0000
commitcd84f77f9b283caf4f506e8f4d68182a3b642ff3 (patch)
treea23efd3d6d208558a762a12c55c152b44e1d471c
parent3b7fe6affb5c80c265c567d0261638e58fade2db (diff)
downloaddrakx-cd84f77f9b283caf4f506e8f4d68182a3b642ff3.tar
drakx-cd84f77f9b283caf4f506e8f4d68182a3b642ff3.tar.gz
drakx-cd84f77f9b283caf4f506e8f4d68182a3b642ff3.tar.bz2
drakx-cd84f77f9b283caf4f506e8f4d68182a3b642ff3.tar.xz
drakx-cd84f77f9b283caf4f506e8f4d68182a3b642ff3.zip
- ask which drive to install bootloader if we don't really know which is first
bios drive (cf #38829)
-rw-r--r--perl-install/any.pm13
-rw-r--r--perl-install/bootloader.pm9
-rw-r--r--perl-install/install/NEWS2
3 files changed, 18 insertions, 6 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index ffa11e00d..b952ad1f6 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -282,13 +282,10 @@ sub setupBootloader_simple {
my $hds = $all_hds->{hds};
require bootloader;
- my $mixed_kind_of_disks = bootloader::mixed_kind_of_disks($hds);
- #- full expert questions when there is 2 kind of disks
- #- it would need a semi_auto asking on which drive the bios boots...
-
- $mixed_kind_of_disks || $b->{bootUnsafe} || arch() =~ /ppc/ or return 1; #- default is good enough
+ bootloader::ensafe_first_bios_drive($hds)
+ || $b->{bootUnsafe} || arch() =~ /ppc/ or return 1; #- default is good enough
- if (!$mixed_kind_of_disks && arch() !~ /ia64/) {
+ if (arch() !~ /ia64/) {
setupBootloader__mbr_or_not($in, $b, $hds, $fstab) or return 0;
} else {
general:
@@ -336,7 +333,11 @@ sub setupBootloader__mbr_or_not {
my $floppy = detect_devices::floppy();
my @l = (
+ bootloader::ensafe_first_bios_drive($hds) ?
+ (map { [ N("First sector (MBR) of drive %s", partition_table::description($_)) => '/dev/' . $_->{device} ] } @$hds)
+ :
[ N("First sector of drive (MBR)") => '/dev/' . $hds->[0]{device} ],
+
[ N("First sector of the root partition") => '/dev/' . fs::get::root($fstab, 'boot')->{device} ],
if_($floppy,
[ N("On Floppy") => "/dev/$floppy" ],
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index d873d5eaa..3b229aecc 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -1448,10 +1448,19 @@ sub hd2bios_kind {
lc(join('_', $hd->{bus}, $hd->{host}));
}
+sub ensafe_first_bios_drive {
+ my ($hds) = @_;
+ mixed_kind_of_disks($hds) || @$hds > 1 && _not_first_bios_drive($hds->[0]);
+}
sub mixed_kind_of_disks {
my ($hds) = @_;
(uniq_ { hd2bios_kind($_) } @$hds) > 1;
}
+sub _not_first_bios_drive {
+ my ($hd) = @_;
+ my $bios = $hd && $hd->{bios_from_edd};
+ $bios && $bios ne '80';
+}
sub sort_hds_according_to_bios {
my ($bootloader, $all_hds) = @_;
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 08ceceac7..24b444482 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,3 +1,5 @@
+- ask which drive to install bootloader if we don't really know which is first
+ bios drive (cf #38829)
- fix reading alternatives in install
Version 10.17 - 20 March 2008