From 75085b969b939ac9ca5ebdf1fe7c36ea4a36b8f5 Mon Sep 17 00:00:00 2001 From: Stew Benedict Date: Wed, 14 Mar 2001 21:45:42 +0000 Subject: fix bootstrap partition creation/tracking allow Xpmac to launch in 2 modes based on cmdline --- perl-install/bootloader.pm | 6 ++++++ perl-install/install_steps_gtk.pm | 3 ++- perl-install/install_steps_interactive.pm | 14 +++++++++++++- perl-install/partition_table_mac.pm | 3 ++- 4 files changed, 23 insertions(+), 3 deletions(-) (limited to 'perl-install') diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index c7b01259e..b7e30f40d 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -501,6 +501,12 @@ sub install_yaboot($$$) { } } log::l("Installing boot loader..."); + close F; + my $f = "$prefix/tmp/of_boot_dev"; + open F, ">$f" or die "cannot create file: $f"; + my $of_dev = get_of_dev($prefix, $lilo->{boot}); + print F "$of_dev"; + close F; $::testing and return; run_program::rooted($prefix, "/sbin/ybin", "2>", "/tmp/.error") or die "ybin failed"; unlink "$prefix/tmp/.error"; diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm index 8b6e623a2..cdd84d41b 100644 --- a/perl-install/install_steps_gtk.pm +++ b/perl-install/install_steps_gtk.pm @@ -47,10 +47,11 @@ sub new($$) { my $launchX = sub { my $ok = 1; + my $xpmac_opts = cat_("/proc/cmdline"); local $SIG{CHLD} = sub { $ok = 0 if waitpid(-1, c::WNOHANG()) > 0 }; unless (fork) { exec $_[0], (arch() =~ /^sparc/ || arch() eq "ppc" ? () : ("-kb")), "-dpms","-s" ,"240", - ($_[0] =~ /Xpmac/ ? ("-mode", "17", "-depth", "32") : ()), + ($_[0] =~ /Xpmac/ ? $xpmac_opts !~ /ofonly/ ? ("-mode", "17", "-depth", "32") : ("-mach64"):()), ($_[0] =~ /Xsun/ || $_[0] =~ /Xpmac/ ? ("-fp", "/usr/X11R6/lib/X11/fonts:unscaled") : ("-allowMouseOpenFail", "-xf86config", $f)) or exit 1; } diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index c5eed7281..a8fe951b7 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -331,7 +331,10 @@ Continue at your own risk!")); if (defined $partition_table_mac::freepart_start && $partition_table_mac::freepart_size >= 1) { my ($hd) = $partition_table_mac::freepart_device; log::l("creating bootstrap partition on drive /dev/$hd->{device}, block $partition_table_mac::freepart_start"); + $partition_table_mac::bootstrap_part = $partition_table_mac::freepart_part; + log::l("bootstrap now at $partition_table_mac::bootstrap_part"); fsedit::add($hd, { start => $partition_table_mac::freepart_start, size => 1 << 11, type => 0x401, mntpoint => '' }, $o->{hds}, { force => 1, primaryOrExtended => 'Primary' }); + run_program::run("hformat", $partition_table_mac::bootstrap_part) or die "hformat of $partition_table_mac::bootstrap_part failed"; } else { die "no free space for 1MB bootstrap"; } @@ -958,7 +961,16 @@ try to force installation even if that destroys the first partition?")); grep { !/^Warning:/ } cat_("$o->{prefix}/tmp/.error") ]); unlink "$o->{prefix}/tmp/.error"; die "already displayed"; - } + } elsif (arch() =~ /ppc/) { + open(FILE, "$o->{prefix}/tmp/of_boot_dev") || die "Can't open $o->{prefix}/tmp/of_boot_dev"; + my $of_boot = ""; + local $_ = ""; + while (){ + $of_boot = $_; + } + unlink "$o->{prefix}/tmp/.error"; + $o->ask_warn('', _("You will need to change your Open Firmware boot-device to\n enable the bootloader. Hold down Command-Option-O-F\n at reboot and enter:\n setenv boot-device $of_boot,\\ofboot.b\n Then type: shut-down\nAt your next boot you should see the bootloader prompt.")); + } } } diff --git a/perl-install/partition_table_mac.pm b/perl-install/partition_table_mac.pm index c4c85d799..52486a776 100644 --- a/perl-install/partition_table_mac.pm +++ b/perl-install/partition_table_mac.pm @@ -2,7 +2,7 @@ package partition_table_mac; # $Id$ use diagnostics; #use strict; - fixed other PPC code to comply, but program bails on empty partition table - sbenedict -use vars qw(@ISA $freepart_device $bootstrap_part $freepart_start $freepart_size $macos_part); +use vars qw(@ISA $freepart_device $bootstrap_part $freepart_start $freepart_size $freepart_part $macos_part); @ISA = qw(partition_table_raw); @@ -144,6 +144,7 @@ sub read($$) { $freepart_start = $h{start}; $freepart_size = $h{size}/2048; $freepart_device = $hd; + $freepart_part = "/dev/" . $hd->{device} . ($i+1); log::l("free apple partition found on drive /dev/$freepart_device->{device}, block $freepart_start, size $freepart_size"); } next; -- cgit v1.2.1