summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-03-01 18:45:43 +0000
committerFrancois Pons <fpons@mandriva.com>2001-03-01 18:45:43 +0000
commitd75a5f7eee17b836d0cf29f0059f5a4b6e399e60 (patch)
treeeb69e10fd65a72273c9e91e5dadc0893e69f7bb3 /perl-install
parent1ecbf955e9385b5a449abe02cd2cedff824d430b (diff)
downloaddrakx-backup-do-not-use-d75a5f7eee17b836d0cf29f0059f5a4b6e399e60.tar
drakx-backup-do-not-use-d75a5f7eee17b836d0cf29f0059f5a4b6e399e60.tar.gz
drakx-backup-do-not-use-d75a5f7eee17b836d0cf29f0059f5a4b6e399e60.tar.bz2
drakx-backup-do-not-use-d75a5f7eee17b836d0cf29f0059f5a4b6e399e60.tar.xz
drakx-backup-do-not-use-d75a5f7eee17b836d0cf29f0059f5a4b6e399e60.zip
added bootloader chooser. added lilo configuration in text menu or
graphic menu.
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/any.pm36
-rw-r--r--perl-install/bootloader.pm11
2 files changed, 33 insertions, 14 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 6ea56b645..1dc241f89 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -94,6 +94,7 @@ sub setupBootloader {
if (!$::expert && $more < 1) {
#- automatic
+ $b->{methods}{lilo} and $b->{methods}{lilo} = "boot-graphic.b";
} elsif (!$::expert) {
my @l = (__("First sector of drive (MBR)"), __("First sector of boot partition"));
@@ -113,25 +114,29 @@ sub setupBootloader {
} else {
$in->set_help(arch() =~ /sparc/ ? "setupSILOGeneral" : "setupBootloaderGeneral") unless $::isStandalone; #- TO MERGE ?
- if ($::expert) {
- my $default = arch() =~ /sparc/ ? 'silo' : 'grub';
- my $m = $in->ask_from_list_('', _("Which bootloader(s) do you want to use?"), [ keys(%{$b->{methods}}), __("None") ], $default) or return;
- $b->{methods}{$_} = 0 foreach keys %{$b->{methods}};
- $b->{methods}{$m} = 1 if $m ne "None";
- }
- #- at least one method
- grep_each { $::b } %{$b->{methods}} or return;
-
- #- put lilo if grub is chosen, so that /etc/lilo.conf is generated
- exists $b->{methods}{lilo} and $b->{methods}{lilo} = 1 if $b->{methods}{grub};
-
my @silo_install_lang = (_("First sector of drive (MBR)"), _("First sector of boot partition"));
my $silo_install_lang = $silo_install_lang[$b->{use_partition}];
+
+ my %bootloaders = (if_(exists $b->{methods}{silo},
+ __("SILO") => sub { $b->{methods}{silo} = 1 }),
+ if_(exists $b->{methods}{lilo},
+ __("LILO with text menu") => sub { $b->{methods}{lilo} = "boot-menu.b" },
+ __("LILO with graphical menu") => sub { $b->{methods}{lilo} = "boot-graphic.b" }),
+ if_(exists $b->{methods}{grub},
+ #- put lilo if grub is chosen, so that /etc/lilo.conf is generated
+ __("Grub") => sub { $b->{methods}{grub} = 1;
+ exists $b->{methods}{lilo}
+ and $b->{methods}{lilo} = "boot-graphic.b" }),
+ if_(exists $b->{methods}{loadlin},
+ __("Boot from DOS/Windows (loadlin)") => sub { $b->{methods}{loadlin} = 1 }),
+ );
+ my $bootloader = arch() =~ /sparc/ ? __("SILO") : __("LILO with graphical menu");
my $profiles = bootloader::has_profiles($b);
my $memsize = bootloader::get_append('mem');
$b->{vga} ||= 'Normal';
$in->ask_from_entries_refH('', _("Bootloader main options"), [
+{ label => _("Bootloader to use"), val => \$bootloader, list => [ keys(%bootloaders) ], },
arch() =~ /sparc/ ? (
{ label => _("Bootloader installation"), val => \$silo_install_lang, list => \@silo_install_lang },
) : (
@@ -160,6 +165,11 @@ sub setupBootloader {
0;
}
) or return 0;
+ $b->{methods}{$_} = 0 foreach keys %{$b->{methods}};
+ $bootloaders{$bootloader} and $bootloaders{$bootloader}->();
+ #- at least one method
+ grep_each { $::b } %{$b->{methods}} or return;
+
$b->{use_partition} = $silo_install_lang eq _("First sector of drive (MBR)") ? 0 : 1;
$b->{vga} = $bootloader::vga_modes{$b->{vga}} || $b->{vga};
@@ -538,7 +548,7 @@ sub setup_thiskind {
my ($in, $type, $auto, $at_least_one) = @_;
return if arch() eq "ppc";
- my @l = setup_thiskind_backend ($type, $auto, $at_least_one, sub { my $w = wait_load_module($in, $type, @_) } );
+ my @l = setup_thiskind_backend ($type, $auto, $at_least_one, sub { my $w = wait_load_module($in, $type, @_); } );
if (!$::noauto) {
if (my @err = grep { $_ } map { $_->{error} } @l) {
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index a2772f371..637681098 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -477,7 +477,13 @@ sub install_lilo($$) {
$lilo->{$_} and print F $_ foreach qw(linear lba32 compact prompt restricted);
#- print F "password=", $lilo->{password} if $lilo->{restricted} && $lilo->{password}; #- done by msec
print F "timeout=", round(10 * $lilo->{timeout}) if $lilo->{timeout};
- print F "message=/boot/message" if $lilo->{message};
+ if ($lilo->{message}) {
+ if (-e "$prefix/boot/$lilo->{methods}{lilo}" && $lilo->{methods}{lilo} eq "boot-graphic.b") {
+ print F "message=/boot/message-graphic";
+ } else {
+ print F "message=/boot/message";
+ }
+ }
print F "menu-scheme=wb:bw:wb:bw";
foreach (@{$lilo->{entries}}) {
@@ -506,6 +512,9 @@ sub install_lilo($$) {
}
}
}
+ #- try to use a specific stage2 if defined and present.
+ -e "$prefix/boot/$lilo->{methods}{lilo}" and symlinkf $lilo->{methods}{lilo}, "$prefix/boot/boot.b";
+ log::l("stage2 of lilo used is " . readlink "$prefix/boot/boot.b");
log::l("Installing boot loader...");
$::testing and return;
run_program::rooted($prefix, "lilo", "2>", "/tmp/.error") or die "lilo failed";