summaryrefslogtreecommitdiffstats
path: root/perl-install/bootloader.pm
diff options
context:
space:
mode:
authorStew Benedict <stewb@mandriva.org>2001-06-14 12:02:30 +0000
committerStew Benedict <stewb@mandriva.org>2001-06-14 12:02:30 +0000
commit90521022de7f69dd97bcbff55e966f767ceae437 (patch)
tree6bdb96457046cae34d91b2a1a0dac05cb4bc0a7e /perl-install/bootloader.pm
parentcd3d662080f9f11ac994972755081764e8c11cd4 (diff)
downloaddrakx-backup-do-not-use-90521022de7f69dd97bcbff55e966f767ceae437.tar
drakx-backup-do-not-use-90521022de7f69dd97bcbff55e966f767ceae437.tar.gz
drakx-backup-do-not-use-90521022de7f69dd97bcbff55e966f767ceae437.tar.bz2
drakx-backup-do-not-use-90521022de7f69dd97bcbff55e966f767ceae437.tar.xz
drakx-backup-do-not-use-90521022de7f69dd97bcbff55e966f767ceae437.zip
use vmlinuz like other archs, fix yaboot setup for seperate /boot partition
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r--perl-install/bootloader.pm27
1 files changed, 19 insertions, 8 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 1be6dfd73..86a4f44f5 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -151,8 +151,7 @@ sub add_entry($$) {
sub add_kernel($$$$$) {
my ($prefix, $lilo, $kernelVersion, $specific, $v) = @_;
my $ext = $specific && "-$specific"; $specific =~ s/\d+\.\d+|hack//;
- my $kname = arch() =~ /ppc/ ? "vmlinux" : "vmlinuz";
- my ($vmlinuz, $image, $initrdImage) = ("$kname-$kernelVersion$specific", "/boot/$kname$ext", "/boot/initrd$ext.img");
+ my ($vmlinuz, $image, $initrdImage) = ("vmlinuz-$kernelVersion$specific", "/boot/vmlinuz$ext", "/boot/initrd$ext.img");
-e "$prefix/boot/$vmlinuz" or log::l("unable to find kernel image $prefix/boot/$vmlinuz"), return;
{
my $f = "initrd-$kernelVersion$specific.img";
@@ -242,6 +241,7 @@ sub suggest {
timeout => 50,
enableofboot => 1,
enablecdboot => 1,
+ useboot => $boot,
} :
{
boot => "/dev/" . ($onmbr ? $hds->[0]{device} : fsedit::get_root($fstab, 'boot')->{device}),
@@ -372,7 +372,7 @@ wait %d seconds for default boot.
}
}
my %l = (
- yaboot => bool(arch() =~ /ppc/),
+ yaboot => bool(arch() =~ /ppc/),
silo => bool(arch() =~ /sparc/),
lilo => bool(arch() !~ /sparc|ppc/) && !isLoopback(fsedit::get_root($fstab)),
grub => bool(arch() !~ /sparc|ppc/ && availableRamMB() < 800), #- don't use grub if more than 800MB
@@ -453,7 +453,7 @@ sub get_of_dev($$) {
}
sub install_yaboot($$$) {
- my ($prefix, $lilo) = @_;
+ my ($prefix, $lilo, $fstab, $hds) = @_;
$lilo->{prompt} = $lilo->{timeout};
if ($lilo->{message}) {
@@ -484,15 +484,26 @@ sub install_yaboot($$$) {
$lilo->{$_} and print F $_ foreach qw(enablecdboot enableofboot);
$lilo->{$_} and print F "$_=$lilo->{$_}" foreach qw(defaultos default);
print F "nonvram";
-
+ my $boot = "/dev/" . $lilo->{useboot} if $lilo->{useboot};
+
foreach (@{$lilo->{entries}}) {
if ($_->{type} eq "image") {
- my $of_dev = get_of_dev($prefix, $_->{root});
- print F "$_->{type}=$of_dev,$_->{kernel_or_dev}";
+ my $of_dev = '';
+ if ($boot !~ /$_->{root}/) {
+ $of_dev = get_of_dev($prefix, $boot);
+ print F "$_->{type}=$of_dev," . substr($_->{kernel_or_dev}, 5);
+ } else {
+ $of_dev = get_of_dev($prefix, $_->{root});
+ print F "$_->{type}=$of_dev,$_->{kernel_or_dev}";
+ }
print F "\tlabel=", substr($_->{label}, 0, 15); #- lilo doesn't handle more than 15 char long labels
print F "\troot=$_->{root}";
- print F "\tinitrd=$of_dev,$_->{initrd}" if $_->{initrd};
+ if ($boot !~ /$_->{root}/) {
+ print F "\tinitrd=$of_dev," . substr($_->{initrd}, 5) if $_->{initrd};
+ } else {
+ print F "\tinitrd=$of_dev,$_->{initrd}" if $_->{initrd};
+ }
print F "\tappend=\"$_->{append}\"" if $_->{append};
print F "\tread-write" if $_->{'read-write'};
print F "\tread-only" if !$_->{'read-write'};