From 754472c45d18d00d6e0d25677912a21c976c7481 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 5 Aug 2004 06:14:59 +0000 Subject: update yaboot code (based on Christiaan Welvaart patch) --- perl-install/bootloader.pm | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'perl-install') diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 84251663f..7a14693d8 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -846,6 +846,10 @@ sub check_enough_space() { sub write_yaboot { my ($bootloader, $_all_hds) = @_; + + my $mac_type = detect_devices::get_mac_model(); + return if $mac_type =~ /Power Macintosh/; + $bootloader->{prompt} ||= $bootloader->{timeout}; if ($bootloader->{message}) { @@ -860,16 +864,21 @@ sub write_yaboot { if ($bootloader->{boot}) { push @conf, "boot=$bootloader->{boot}"; push @conf, "ofboot=" . get_of_dev($bootloader->{boot}) + } elsif ($mac_type =~ /IBM/) { + push @conf, "boot=/dev/sda1"; } else { die "no bootstrap partition defined." } - push @conf, map { "$_=$bootloader->{$_}" } grep { $bootloader->{$_} } qw(delay timeout defaultos default); + push @conf, map { "$_=$bootloader->{$_}" } grep { $bootloader->{$_} } (qw(delay timeout default), if_($mac_type !~ /IBM/, 'defaultos')); push @conf, "install=/usr/lib/yaboot/yaboot"; - push @conf, "magicboot=/usr/lib/yaboot/ofboot"; - push @conf, grep { $bootloader->{$_} } qw(enablecdboot enableofboot); - #- push @conf, "nonvram"; - my $boot = "/dev/" . $bootloader->{useboot} if $bootloader->{useboot}; + if ($mac_type =~ /IBM/) { + push @conf, 'nonvram'; + } else { + push @conf, 'magicboot=/usr/lib/yaboot/ofboot'; + push @conf, grep { $bootloader->{$_} } qw(enablecdboot enableofboot); + } + my $boot = $bootloader->{useboot} && "/dev/" . $bootloader->{useboot}; foreach (@{$bootloader->{entries}}) { @@ -914,9 +923,10 @@ sub install_yaboot { } sub when_config_changed_yaboot { my ($bootloader) = @_; - my $f = "$::prefix/tmp/of_boot_dev"; - my $of_dev = get_of_dev($bootloader->{boot}); - output($f, "$of_dev\n"); + if ($bootloader->{boot}) { + my $of_dev = get_of_dev($bootloader->{boot}); + output("$::prefix/tmp/of_boot_dev", "$of_dev\n"); + } $::testing and return; if (defined $install_steps_interactive::new_bootstrap) { run_program::run("hformat", $bootloader->{boot}) or die "hformat failed"; -- cgit v1.2.1