summaryrefslogtreecommitdiffstats
path: root/perl-install/bootloader.pm
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mandriva.org>2009-02-09 18:09:29 +0000
committerPascal Terjan <pterjan@mandriva.org>2009-02-09 18:09:29 +0000
commitf0c56a51a76547a8357c17f31ebee1edf74cc227 (patch)
treec613a88d11140b4e3432e91933a27cebc753953a /perl-install/bootloader.pm
parentf6a6c074b5a9bd50c5437607c31d0b14a25982ef (diff)
downloaddrakx-backup-do-not-use-f0c56a51a76547a8357c17f31ebee1edf74cc227.tar
drakx-backup-do-not-use-f0c56a51a76547a8357c17f31ebee1edf74cc227.tar.gz
drakx-backup-do-not-use-f0c56a51a76547a8357c17f31ebee1edf74cc227.tar.bz2
drakx-backup-do-not-use-f0c56a51a76547a8357c17f31ebee1edf74cc227.tar.xz
drakx-backup-do-not-use-f0c56a51a76547a8357c17f31ebee1edf74cc227.zip
When installing to a removable device, put boot sector there, else put it into first non removable drive (#47106)
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r--perl-install/bootloader.pm12
1 files changed, 10 insertions, 2 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 32fe34898..095c581d2 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -977,8 +977,16 @@ sub suggest {
my $boot = fs::get::root($fstab, 'boot')->{device};
#- PPC xfs module requires enlarged initrd
my $xfsroot = $root_part->{fs_type} eq 'xfs';
+ my $mbr;
+
+ # If installing onto an USB drive, put the mbr there, else on the first non removable drive
+ if ($root_part->{is_removable}) {
+ $mbr = find { $_->{device} eq $root_part->{rootDevice} } $all_hds->{hds};
+ } else {
+ $mbr = find { !$_->{is_removable} } $all_hds->{hds};
+ }
- my ($onmbr, $unsafe) = $bootloader->{crushMbr} ? (1, 0) : suggest_onmbr($all_hds->{hds}[0]);
+ my ($onmbr, $unsafe) = $bootloader->{crushMbr} ? (1, 0) : suggest_onmbr($mbr);
add2hash_($bootloader, arch() =~ /ppc/ ?
{
defaultos => "linux",
@@ -999,7 +1007,7 @@ sub suggest {
timeout => $onmbr && 10,
nowarn => 1,
if_(arch() !~ /ia64/,
- boot => "/dev/" . ($onmbr ? $all_hds->{hds}[0]{device} : $boot),
+ boot => "/dev/" . ($onmbr ? $mbr->{device} : $boot),
map => "/boot/map",
compact => 1,
color => 'black/cyan yellow/cyan',