summaryrefslogtreecommitdiffstats
path: root/perl-install/bootloader.pm
diff options
context:
space:
mode:
authorArnaud Patard <rtp@mageia.org>2011-03-18 21:33:11 +0000
committerArnaud Patard <rtp@mageia.org>2011-03-18 21:33:11 +0000
commit2bfae95a970f4c7284a2484fb967bbf9174c2cc6 (patch)
tree0ee61668e342609cc56f0755d5edd2277e66aef3 /perl-install/bootloader.pm
parenteea2f8ef9ddf7e461702d8fda0b8e98e623694c2 (diff)
downloaddrakx-2bfae95a970f4c7284a2484fb967bbf9174c2cc6.tar
drakx-2bfae95a970f4c7284a2484fb967bbf9174c2cc6.tar.gz
drakx-2bfae95a970f4c7284a2484fb967bbf9174c2cc6.tar.bz2
drakx-2bfae95a970f4c7284a2484fb967bbf9174c2cc6.tar.xz
drakx-2bfae95a970f4c7284a2484fb967bbf9174c2cc6.zip
- import stage1/drakxtools mips support
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r--perl-install/bootloader.pm44
1 files changed, 39 insertions, 5 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index e1e107db8..bd85f8446 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -22,7 +22,7 @@ use modules;
#-#####################################################################################
#- Functions
#-#####################################################################################
-my $vmlinuz_regexp = 'vmlinuz|win4lin';
+my $vmlinuz_regexp = 'vmlinu[xz]|win4lin';
my $decompose_vmlinuz_name = qr/((?:$vmlinuz_regexp).*?)-(\d+\.\d+.*)/;
sub expand_vmlinuz_symlink {
@@ -57,7 +57,7 @@ sub kernel_str2short_name {
sub basename2initrd_basename {
my ($basename) = @_;
- $basename =~ s!vmlinuz-?!!; #- here we do not use $vmlinuz_regexp since we explictly want to keep all that is not "vmlinuz"
+ $basename =~ s!vmlinu[zx]-?!!; #- here we do not use $vmlinuz_regexp since we explictly want to keep all that is not "vmlinuz"
'initrd' . ($basename ? "-$basename" : '');
}
sub kernel_str2vmlinuz_long {
@@ -188,7 +188,7 @@ sub read {
if (m!/fd\d+$!) {
warn "not checking the method on floppy, assuming $main_method is right\n";
$main_method;
- } elsif (member($main_method, qw(yaboot cromwell silo))) {
+ } elsif (member($main_method, qw(yaboot cromwell silo pmon2000))) {
#- not checking, there's only one bootloader anyway :)
$main_method;
} elsif (my $type = partition_table::raw::typeOfMBR($_)) {
@@ -409,6 +409,11 @@ sub read_silo() {
$bootloader->{method} = 'silo';
$bootloader;
}
+sub read_pmon2000() {
+ my %b;
+ $b{method} = 'pmon2000';
+ \%b;
+}
sub read_cromwell() {
my %b;
$b{method} = 'cromwell';
@@ -724,6 +729,7 @@ sub add_kernel {
#- new versions of yaboot do not handle symlinks
$b_nolink ||= arch() =~ /ppc/;
+ $b_no_initrd //= arch() =~ /mips/ && !detect_devices::is_mips_gdium();
$b_nolink ||= $kernel_str->{use_long_name};
@@ -742,11 +748,25 @@ sub add_kernel {
if (!$b_nolink) {
$v->{kernel_or_dev} = '/boot/' . kernel_str2vmlinuz_short($kernel_str);
- _do_the_symlink($bootloader, $v->{kernel_or_dev}, $vmlinuz_long);
+ if (arch() =~ /mips/) {
+ log::l("link $::prefix/boot/$vmlinuz_long -> $::prefix$v->{kernel_or_dev}");
+ linkf("$::prefix/boot/$vmlinuz_long", $::prefix . $v->{kernel_or_dev});
+ linkf("$::prefix/boot/$vmlinuz_long", $::prefix . $v->{kernel_or_dev} . ".32");
+ } else {
+ _do_the_symlink($bootloader, $v->{kernel_or_dev}, $vmlinuz_long);
+ }
if ($v->{initrd}) {
$v->{initrd} = '/boot/' . kernel_str2initrd_short($kernel_str);
- _do_the_symlink($bootloader, $v->{initrd}, $initrd_long);
+ if (arch() =~ /mips/) {
+ log::l("link $::prefix/boot/$initrd_long -> $::prefix$v->{initrd}");
+ linkf("$::prefix/boot/$initrd_long", $::prefix . $v->{initrd});
+ if ($v->{initrd} =~ s/.img$/.gz/) {
+ linkf("$::prefix/boot/$initrd_long", $::prefix . $v->{initrd});
+ }
+ } else {
+ _do_the_symlink($bootloader, $v->{initrd}, $initrd_long);
+ }
}
}
@@ -1157,6 +1177,7 @@ sub method_choices_raw {
arch() =~ /ppc/ ? 'yaboot' :
arch() =~ /ia64/ ? 'lilo' :
arch() =~ /sparc/ ? 'silo' :
+ arch() =~ /mips/ ? 'pmon2000' :
(
if_(!$b_prefix_mounted || whereis_binary('grub', $::prefix),
'grub-graphic', 'grub-menu'),
@@ -1320,6 +1341,19 @@ sub when_config_changed_yaboot {
run_program::rooted($::prefix, "/usr/sbin/ybin", "2>", \$error) or die "ybin failed: $error";
}
+sub install_pmon2000 {
+ my ($_bootloader, $_all_hds) = @_;
+ log::l("Mips/pmon2000 - nothing to install...");
+}
+sub write_pmon2000 {
+ my ($_bootloader, $_all_hds) = @_;
+ log::l("Mips/pmon2000 - nothing to write...");
+}
+sub when_config_changed_pmon2000 {
+ my ($_bootloader) = @_;
+ log::l("Mips/pmon2000 - nothing to do...");
+}
+
sub install_cromwell {
my ($_bootloader, $_all_hds) = @_;
log::l("XBox/Cromwell - nothing to install...");