diff options
author | Stew Benedict <stewb@mandriva.org> | 2002-03-07 00:40:00 +0000 |
---|---|---|
committer | Stew Benedict <stewb@mandriva.org> | 2002-03-07 00:40:00 +0000 |
commit | 920f7d3d0ed4129054a1bf563029cb8e095ec165 (patch) | |
tree | f54c6cf9af66819184f7e3a98432fc4eef4d3b16 /perl-install/bootloader.pm | |
parent | cab195d756d2c740385402de7e1cbf67e428f393 (diff) | |
download | drakx-920f7d3d0ed4129054a1bf563029cb8e095ec165.tar drakx-920f7d3d0ed4129054a1bf563029cb8e095ec165.tar.gz drakx-920f7d3d0ed4129054a1bf563029cb8e095ec165.tar.bz2 drakx-920f7d3d0ed4129054a1bf563029cb8e095ec165.tar.xz drakx-920f7d3d0ed4129054a1bf563029cb8e095ec165.zip |
drakboot functionality for PPC
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r-- | perl-install/bootloader.pm | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 60e048e7e..6975267be 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -85,6 +85,9 @@ sub read($$) { ($_, $v) = /^\s*(.*?)\s*(?:=\s*(.*?))?\s*$/; if (/^(image|other)$/) { + if (arch() =~ /ppc/) { + $v =~ s/hd:\d+,//g; + } push @{$b{entries}}, $e = { type => $_, kernel_or_dev => $v }; $global = 0; } elsif ($global) { @@ -92,6 +95,10 @@ sub read($$) { $b{bios}{$1} = $2; } elsif ($_ eq 'bios') { $b{bios}{$b{disk}} = $v; + } elsif ($_ eq 'init-message') { + $v =~ s/\\n//g; + $v =~ s/"//g; + $b{init-message} = $v; } else { $b{$_} = $v || 1; } @@ -99,14 +106,20 @@ sub read($$) { if ((/map-drive/ .. /to/) && /to/) { $e->{mapdrive}{$e->{'map-drive'}} = $v; } else { + if (arch() =~ /ppc/) { + $v =~ s/hd:\d+,//g; + $v =~ s/"//g; + } $e->{$_} = $v || 1; } } } - delete $b{timeout} unless $b{prompt}; - $_->{append} =~ s/^\s*"?(.*?)"?\s*$/$1/ foreach \%b, @{$b{entries}}; - $b{timeout} = $b{timeout} / 10 if $b{timeout}; - $b{message} = cat_("$prefix$b{message}") if $b{message}; + if (arch() != /ppc/) { + delete $b{timeout} unless $b{prompt}; + $_->{append} =~ s/^\s*"?(.*?)"?\s*$/$1/ foreach \%b, @{$b{entries}}; + $b{timeout} = $b{timeout} / 10 if $b{timeout}; + $b{message} = cat_("$prefix$b{message}") if $b{message}; + } \%b; } @@ -309,11 +322,11 @@ sub suggest { root => "/dev/$root", partition => $partition || 1, boot => $root eq $boot && "/boot", #- this helps for getting default partition for silo. - } : arch =~ /ppc/ ? + } : arch() =~ /ppc/ ? { defaultos => "linux", entries => [], - initmsg => "Welcome to Mandrake Linux!", + init-message => "Welcome to Mandrake Linux!", delay => 30, #- OpenFirmware delay timeout => 50, enableofboot => 1, @@ -394,11 +407,11 @@ wait %d seconds for default boot. } } elsif (arch() =~ /ppc/) { #- if we identified a MacOS partition earlier - add it - if (defined $partition_table_mac'macos_part) { + if (defined $partition_table_mac::macos_part) { add_entry($lilo->{entries}, { label => "macos", - kernel_or_dev => $partition_table_mac'macos_part + kernel_or_dev => $partition_table_mac::macos_part }); } } elsif (arch() !~ /ia64/) { @@ -525,7 +538,7 @@ sub install_yaboot($$$) { log::l("writing yaboot config to $f"); print F "#yaboot.conf - generated by DrakX"; - print F "init-message=\"\\n$lilo->{initmsg}\\n\"" if $lilo->{initmsg}; + print F "init-message=\"\\n$lilo->{init-message}\\n\"" if $lilo->{init-message}; if ($lilo->{boot}) { print F "boot=$lilo->{boot}"; @@ -540,14 +553,14 @@ sub install_yaboot($$$) { print F "magicboot=/usr/local/lib/yaboot/ofboot"; $lilo->{$_} and print F $_ foreach qw(enablecdboot enableofboot); $lilo->{$_} and print F "$_=$lilo->{$_}" foreach qw(defaultos default); - print F "nonvram"; + #- print F "nonvram"; my $boot = "/dev/" . $lilo->{useboot} if $lilo->{useboot}; foreach (@{$lilo->{entries}}) { if ($_->{type} eq "image") { my $of_dev = ''; - if ($boot !~ /$_->{root}/) { + if (($boot !~ /$_->{root}/) && $boot) { $of_dev = get_of_dev($prefix, $boot); print F "$_->{type}=$of_dev," . substr($_->{kernel_or_dev}, 5); } else { @@ -556,14 +569,14 @@ sub install_yaboot($$$) { } print F "\tlabel=", substr($_->{label}, 0, 15); #- lilo doesn't handle more than 15 char long labels print F "\troot=$_->{root}"; - if ($boot !~ /$_->{root}/) { + if (($boot !~ /$_->{root}/) && $boot) { print F "\tinitrd=$of_dev," . substr($_->{initrd}, 5) if $_->{initrd}; } else { print F "\tinitrd=$of_dev,$_->{initrd}" if $_->{initrd}; } #- xfs module on PPC requires larger initrd - say 6MB? print F "\tinitrd-size=6144" if $lilo->{xfsroot}; - print F "\tappend=\"$_->{append}\"" if $_->{append}; + print F "\tappend=\" $_->{append}\"" if $_->{append}; print F "\tread-write" if $_->{'read-write'}; print F "\tread-only" if !$_->{'read-write'}; } else { |