diff options
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/Xconfigurator.pm | 7 | ||||
-rw-r--r-- | perl-install/bootloader.pm | 33 |
2 files changed, 28 insertions, 12 deletions
diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm index 17e628d7a..459932c1f 100644 --- a/perl-install/Xconfigurator.pm +++ b/perl-install/Xconfigurator.pm @@ -287,7 +287,12 @@ NOTE THIS IS EXPERIMENTAL SUPPORT AND MAY FREEZE YOUR COMPUTER.", $xf3_ver)) . " #- in case of class discarding, this can help ... $tc or $tc = $choices[0]; $tc->{code} and $tc->{code}(); - + + #- ugly hack - force 4.0.x for PPC in recommended mode + if (!$::expert && arch() =~ /ppc/) { + $card->{use_xf4} = 1; + } + $card->{prog} = "/usr/X11R6/bin/" . ($card->{use_xf4} ? 'XFree86' : $card->{server} =~ /Sun (.*)/x ? "Xsun$1" : "XF86_$card->{server}"); diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 6f52d9fa0..efa42ac81 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -429,14 +429,25 @@ sub set_profiles { } -sub get_of_dev($) { - my ($unix_dev) = @_; - open(INPIPE, "/usr/local/sbin/ofpath $unix_dev|") || die "Couldn't find ofpath"; - my $of_dev = <INPIPE>; - close(INPIPE); +sub get_of_dev($$) { + my ($prefix, $unix_dev) = @_; + #- don't care much for this - need to run ofpath rooted, and I need the result + #- In test mode, just run on "/", otherwise you can't get to the /proc files + if ($::testing) { + $prefix = ""; + } + run_program::rooted_or_die($prefix, "/usr/local/sbin/ofpath $unix_dev", ">", "/tmp/ofpath"); + open(FILE, "$prefix/tmp/ofpath") || die "Can't open $prefix/tmp/ofpath"; + my $of_dev = ""; + local $_ = ""; + while(<FILE>){ + $of_dev = $_; + } chop($of_dev); + my @del_file = ($prefix . "/tmp/ofpath"); + unlink (@del_file); log::l("OF Device: $of_dev"); - $of_dev; + $of_dev; } sub install_yaboot($$$) { @@ -459,7 +470,7 @@ sub install_yaboot($$$) { if ($lilo->{boot}) { print F "boot=$lilo->{boot}"; - my $of_dev = get_of_dev($lilo->{boot}); + my $of_dev = get_of_dev($prefix, $lilo->{boot}); print F "ofboot=$of_dev"; } else { die "no bootstrap partition defined." @@ -472,11 +483,11 @@ sub install_yaboot($$$) { $lilo->{$_} and print F "$_=$lilo->{$_}" foreach qw(defaultos default); print F "nonvram"; - foreach (@{$lilo->{entries}}) { #- at the moment we only automatically do the 1st HD + foreach (@{$lilo->{entries}}) { if ($_->{type} eq "image") { - my $of_dev = get_of_dev($_->{root}); - print F "$_->{type}=$of_dev,$_->{kernel_or_dev}"; + my $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=$_->{initrd}" if $_->{initrd}; @@ -484,7 +495,7 @@ sub install_yaboot($$$) { print F "\tread-write" if $_->{'read-write'}; print F "\tread-only" if !$_->{'read-write'}; } else { - my $of_dev = get_of_dev($_->{kernel_or_dev}); + my $of_dev = get_of_dev($prefix, $_->{kernel_or_dev}); print F "$_->{label}=$of_dev"; } } |