diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-10-26 15:29:33 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-10-26 15:29:33 +0000 |
commit | 150b8ceb722bdbd393f6237a62eddffbbd7c64b6 (patch) | |
tree | b30d618ea3beed82353cfcdf6403b9074c6f139b /perl-install/bootloader.pm | |
parent | ef75b17e8aae527ed507a738ba9ab8632c7c1805 (diff) | |
download | drakx-150b8ceb722bdbd393f6237a62eddffbbd7c64b6.tar drakx-150b8ceb722bdbd393f6237a62eddffbbd7c64b6.tar.gz drakx-150b8ceb722bdbd393f6237a62eddffbbd7c64b6.tar.bz2 drakx-150b8ceb722bdbd393f6237a62eddffbbd7c64b6.tar.xz drakx-150b8ceb722bdbd393f6237a62eddffbbd7c64b6.zip |
detectloader must handle specially raid-extra-boot=mbr-only (bugzilla #12089)
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r-- | perl-install/bootloader.pm | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index b3c9b045b..31bb13665 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -145,13 +145,28 @@ sub add_boot_splash { } sub read { - my ($fstab) = @_; + my ($all_hds) = @_; + my $fstab = [ fs::get::fstab($all_hds) ]; my @methods = method_choices_raw(); foreach my $main_method (uniq(map { main_method($_) } @methods)) { my $f = $bootloader::{"read_$main_method"} or die "unknown bootloader method $main_method (read)"; my $bootloader = $f->($fstab); - my $type = partition_table::raw::typeOfMBR($bootloader->{boot}); - warn "typeOfMBR $type on $bootloader->{boot} for method $main_method\n" if $ENV{DEBUG}; + + my @devs = $bootloader->{boot}; + if ($bootloader->{'raid-extra-boot'} =~ /mbr/ && + (my $md = fs::get::device2part($bootloader->{boot}, $all_hds->{raids}))) { + @devs = map { $_->{rootDevice} } @{$md->{disks}}; + } elsif ($bootloader->{'raid-extra-boot'} =~ m!/dev/!) { + @devs = split(',', $bootloader->{'raid-extra-boot'}); + } + + my ($type) = map { + if (my $type = partition_table::raw::typeOfMBR($_)) { + warn "typeOfMBR $type on $_ for method $main_method\n" if $ENV{DEBUG}; + $type; + } else { () } + } @devs; + if ($type eq $main_method) { my @prefered_entries = map { get_label($_, $bootloader) } $bootloader->{default}, 'linux'; @@ -780,8 +795,8 @@ wait for default boot. } sub detect_main_method { - my ($fstab) = @_; - my $bootloader = &read($fstab); + my ($all_hds) = @_; + my $bootloader = &read($all_hds); $bootloader && main_method($bootloader->{method}); } @@ -1328,7 +1343,7 @@ sub update_for_renumbered_partitions { } } - my $main_method = detect_main_method([ fs::get::fstab($all_hds) ]); + my $main_method = detect_main_method($all_hds); my @needed = $main_method ? $main_method : ('lilo', 'grub'); if (find { my $config = $_ eq 'grub' ? 'grub_install' : $_; |