summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-03-11 16:00:44 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-03-11 16:00:44 +0000
commit633800e3c3c1e2771ea1f2fbf0745cec9e600aa4 (patch)
treede646ab3e5783a9db0f55230a5f101a2194631b9
parent891b21bf2c2f5e434493bca814d0fc3ea8dc5118 (diff)
downloaddrakx-backup-do-not-use-633800e3c3c1e2771ea1f2fbf0745cec9e600aa4.tar
drakx-backup-do-not-use-633800e3c3c1e2771ea1f2fbf0745cec9e600aa4.tar.gz
drakx-backup-do-not-use-633800e3c3c1e2771ea1f2fbf0745cec9e600aa4.tar.bz2
drakx-backup-do-not-use-633800e3c3c1e2771ea1f2fbf0745cec9e600aa4.tar.xz
drakx-backup-do-not-use-633800e3c3c1e2771ea1f2fbf0745cec9e600aa4.zip
fix lilo-menu not working (bug #3048)
-rw-r--r--perl-install/any.pm2
-rw-r--r--perl-install/bootloader.pm29
-rwxr-xr-xperl-install/standalone/drakboot2
3 files changed, 16 insertions, 17 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 34bce2ffc..3b3be9378 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -237,7 +237,7 @@ sub setupBootloader__general {
my @silo_install_lang = (N("First sector of drive (MBR)"), N("First sector of boot partition"));
- ($b->{method}, my $method_choices) = bootloader::method_choices($fstab);
+ ($b->{method}, my $method_choices) = bootloader::method_choices($fstab, $b);
my $profiles = bootloader::has_profiles($b);
my $prev_force_acpi = my $force_acpi = bootloader::get_append($b, 'acpi') ne 'off';
my $prev_force_noapic = my $force_noapic = bootloader::get_append($b, 'noapic');
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 2181b5b6c..bc3ae3319 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -127,7 +127,7 @@ sub read() {
$_->{label} = remove_quotes_and_spaces($_->{label}) foreach @{$b{entries}};
$b{default} = remove_quotes_and_spaces($b{default}) if $b{default};
$b{timeout} = $b{timeout} / 10 if $b{timeout};
- $b{message} = cat_("$::prefix$b{message}") if $b{message};
+ delete $b{message};
}
#- cleanup duplicate labels (in case file is corrupted)
@@ -476,9 +476,7 @@ sub suggest {
});
if (!$bootloader->{message} || $bootloader->{message} eq "1") {
- $bootloader->{message} = join('', cat_("$::prefix/boot/message"));
- if (!$bootloader->{message}) {
- my $msg_en =
+ my $msg_en =
#-PO: these messages will be displayed at boot time in the BIOS, use only ASCII (7bit)
N_("Welcome to %s the operating system chooser!
@@ -486,11 +484,10 @@ Choose an operating system from the list above or
wait %d seconds for default boot.
");
- my $msg = translate($msg_en);
- #- use the english version if more than 20% of 8bits chars
- $msg = $msg_en if int(grep { $_ & 0x80 } unpack "c*", $msg) / length($msg) > 0.2;
- $bootloader->{message} = sprintf $msg, arch() =~ /sparc/ ? "SILO" : "LILO", $bootloader->{timeout};
- }
+ my $msg = translate($msg_en);
+ #- use the english version if more than 20% of 8bits chars
+ $msg = $msg_en if int(grep { $_ & 0x80 } unpack "c*", $msg) / length($msg) > 0.2;
+ $bootloader->{message} = sprintf $msg, arch() =~ /sparc/ ? "SILO" : "LILO", $bootloader->{timeout};
}
add2hash_($bootloader, { memsize => $1 }) if cat_("/proc/cmdline") =~ /\bmem=(\d+[KkMm]?)(?:\s.*)?$/;
@@ -576,11 +573,11 @@ wait %d seconds for default boot.
}
}
$bootloader->{default} ||= "linux";
- $bootloader->{method} = first(method_choices($fstab));
+ $bootloader->{method} = first(method_choices($fstab, $bootloader));
}
sub method_choices {
- my ($fstab) = @_;
+ my ($fstab, $bootloader) = @_;
my %choices = (
if_(arch() =~ /sparc/,
'silo' => N("SILO"),
@@ -595,7 +592,7 @@ sub method_choices {
);
my $prefered;
$prefered ||= 'grub' if $::isStandalone && run_program::rooted_get_stdout($::prefix, 'detectloader') =~ /GRUB/;
- $prefered ||= 'lilo-graphic';
+ $prefered ||= 'lilo-' . (member($bootloader->{install}, 'text', 'menu', 'graphic') ? $bootloader->{install} : 'graphic');
my $default = exists $choices{$prefered} ? $prefered : first(keys %choices);
$default, \%choices;
@@ -914,9 +911,13 @@ sub write_lilo_conf {
sub install_lilo {
my ($bootloader, $fstab, $hds, $method) = @_;
- $bootloader->{install} = 'text' if $method eq 'lilo-text';
+ if (my ($install) = $method =~ /lilo-(text|menu)/) {
+ $bootloader->{install} = $install;
+ } else {
+ delete $bootloader->{install};
+ }
output("$::prefix/boot/message-text", $bootloader->{message}) if $bootloader->{message};
- symlinkf "message-" . ($method eq 'lilo-text' ? 'text' : 'graphic'), "$::prefix/boot/message";
+ symlinkf "message-" . ($method ne 'lilo-graphic' ? 'text' : 'graphic'), "$::prefix/boot/message";
write_lilo_conf($bootloader, $fstab, $hds);
diff --git a/perl-install/standalone/drakboot b/perl-install/standalone/drakboot
index 7749603aa..63d92dba0 100755
--- a/perl-install/standalone/drakboot
+++ b/perl-install/standalone/drakboot
@@ -319,8 +319,6 @@ $in->exit(0);
sub lilo_choice {
my $bootloader = bootloader::read();
- local ($_) = `detectloader`;
- $bootloader->{methods} = { lilo => 1, grub => !!/grub/i, if_(arch() =~ /ppc/, yaboot => 1) };
my ($all_hds) = fsedit::get_hds();
my $fstab = [ fsedit::get_all_fstab($all_hds) ];