summaryrefslogtreecommitdiffstats
path: root/perl-install/bootloader.pm
diff options
context:
space:
mode:
authorMystery Man <unknown@mandriva.org>2005-10-20 14:05:54 +0000
committerMystery Man <unknown@mandriva.org>2005-10-20 14:05:54 +0000
commit9b6a0d83d135fad376b4eadcb2bd7bd8c8a07aa5 (patch)
treef3ef7ada2ce82dafb6d41cc087b0cc7fdfc40a46 /perl-install/bootloader.pm
parent3e4ad5e1b687f262a1d7cc39a0b905a595ac7f95 (diff)
downloaddrakx-backup-do-not-use-10736c53ca91aed19de81858bf3358c6b2c9ab13.tar
drakx-backup-do-not-use-10736c53ca91aed19de81858bf3358c6b2c9ab13.tar.gz
drakx-backup-do-not-use-10736c53ca91aed19de81858bf3358c6b2c9ab13.tar.bz2
drakx-backup-do-not-use-10736c53ca91aed19de81858bf3358c6b2c9ab13.tar.xz
drakx-backup-do-not-use-10736c53ca91aed19de81858bf3358c6b2c9ab13.zip
This commit was manufactured by cvs2svn to create tagV10_34_11_100mdk
'V10_34_11_100mdk'.
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r--perl-install/bootloader.pm42
1 files changed, 29 insertions, 13 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 0cdbfc1bd..6429cb00a 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -39,6 +39,21 @@ our %vga_modes = (
#-#####################################################################################
#- Functions
#-#####################################################################################
+my $vmlinuz_regexp = 'vmlinuz|win4lin';
+my $decompose_vmlinuz_name = qr/((?:$vmlinuz_regexp).*?)-(\d+\.\d+.*)/;
+
+sub expand_vmlinuz_symlink {
+ my ($vmlinuz) = @_;
+ my $f = $::prefix . ($vmlinuz =~ m!^/! ? $vmlinuz : "/boot/$vmlinuz");
+ -l $f ? readlink($f) : $vmlinuz;
+}
+
+sub installed_vmlinuz_raw() { grep { /^($vmlinuz_regexp)/ } all("$::prefix/boot") }
+sub installed_vmlinuz() { grep { ! -l "$::prefix/boot/$_" } installed_vmlinuz_raw() }
+sub vmlinuz2version {
+ my ($vmlinuz) = @_;
+ expand_vmlinuz_symlink($vmlinuz) =~ /$decompose_vmlinuz_name/ && $2;
+}
sub get {
my ($kernel, $bootloader) = @_;
@@ -658,18 +673,21 @@ sub detect_bootloader() {
sub method_choices {
my ($fstab, $bootloader) = @_;
- my %choices = (
- if_(arch() =~ /sparc/,
+ my %choices =
+ arch() =~ /sparc/ ? (
'silo' => N("SILO"),
- ), if_(arch() !~ /sparc|ppc/ && !isLoopback(fsedit::get_root($fstab)) && whereis_binary('lilo'),
- if_(!detect_devices::matching_desc('ProSavageDDR'), 'lilo-graphic' => N("LILO with graphical menu")),
- 'lilo-menu' => N("LILO with text menu"),
- ), if_(arch() !~ /sparc|ppc/ && !isRAID(fsedit::get_root($fstab)) && whereis_binary('grub'),
- 'grub' => N("Grub"),
- ), if_(arch() =~ /ppc/,
+ ) : arch() =~ /ppc/ ? (
'yaboot' => N("Yaboot"),
- ),
- );
+ ) : arch() =~ /ia64/ ? (
+ 'lilo' => N("Elilo"),
+ ) : (
+ if_(!isLoopback(fsedit::get_root($fstab)) && whereis_binary('lilo'),
+ if_(!detect_devices::matching_desc('ProSavageDDR'), 'lilo-graphic' => N("LILO with graphical menu")),
+ 'lilo-menu' => N("LILO with text menu"),
+ ), if_(!isRAID(fsedit::get_root($fstab)) && whereis_binary('grub'),
+ 'grub' => N("Grub"),
+ ),
+ );
my $prefered;
$prefered ||= 'grub' if $::isStandalone && detect_bootloader() =~ /GRUB/;
$prefered ||= 'lilo-' . (member($bootloader->{install}, 'text', 'menu', 'graphic') ? $bootloader->{install} : 'graphic');
@@ -1152,10 +1170,8 @@ sub install_grub {
if (!$::testing) {
log::l("Installing boot loader...");
- symlink "$::prefix/boot", "/boot";
my $error;
- run_program::run("sh", $f, "2>", \$error) or die "grub failed: $error";
- unlink "/boot";
+ run_program::rooted($::prefix, "sh", $f, "2>", \$error) or die "grub failed: $error";
}
}