summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-01-22 22:17:23 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-01-22 22:17:23 +0000
commit68f8fc470b9d97ab209ab6d106a2efd7b4df83dd (patch)
tree0f3bbb59c7d14224960f776a80d3fbc12ac9750f
parent4215d770341c72ec139ed5d5332d7406c08cde16 (diff)
downloaddrakx-68f8fc470b9d97ab209ab6d106a2efd7b4df83dd.tar
drakx-68f8fc470b9d97ab209ab6d106a2efd7b4df83dd.tar.gz
drakx-68f8fc470b9d97ab209ab6d106a2efd7b4df83dd.tar.bz2
drakx-68f8fc470b9d97ab209ab6d106a2efd7b4df83dd.tar.xz
drakx-68f8fc470b9d97ab209ab6d106a2efd7b4df83dd.zip
fix yves's code duplication of lilo_choice (use $::lilo_choice in bootlook)
-rw-r--r--perl-install/bootlook.pm27
-rwxr-xr-xperl-install/standalone/drakboot23
2 files changed, 15 insertions, 35 deletions
diff --git a/perl-install/bootlook.pm b/perl-install/bootlook.pm
index fd0505167..4ca78f895 100644
--- a/perl-install/bootlook.pm
+++ b/perl-install/bootlook.pm
@@ -101,7 +101,7 @@ gtkadd($window,
gtkpack__(new Gtk::HBox(0, 0),
_("You are currently using %s as Boot Manager.
Click on Configure to launch the setup wizard.", $lilogrub),
- gtksignal_connect(new Gtk::Button (_("Configure")), clicked => \&lilo_choice)
+ gtksignal_connect(new Gtk::Button (_("Configure")), clicked => $::lilo_choice)
)
),
# aurora
@@ -314,28 +314,3 @@ sub set_autologin {
}
-#-------------------------------------------------------------
-# lilo/grub functions
-#-------------------------------------------------------------
-sub lilo_choice {
- my $bootloader = bootloader::read('', '/etc/lilo.conf');
- local ($_) = `detectloader`;
- $bootloader->{methods} = { lilo => 1, grub => !!/grub/i };
-
- my ($all_hds) = catch_cdie { fsedit::hds([ detect_devices::hds() ], {}) } sub { 1 };
- my $fstab = [ fsedit::get_all_fstab($all_hds) ];
- fs::merge_info_from_fstab($fstab);
-
- $::expert=1;
- ask:
- local $::isEmbedded = 0;
- any::setupBootloader($in, $bootloader, $all_hds, $fstab, $ENV{SECURE_LEVEL}) or return;
- eval { bootloader::install('', $bootloader, $fstab, $all_hds->{hds}) };
- if ($@) {
- $in->ask_warn('',
- [ _("Installation of LILO failed. The following error occured:"),
- grep { !/^Warning:/ } cat_("/tmp/.error") ]);
- unlink "/tmp/.error";
- goto ask;
- }
-}
diff --git a/perl-install/standalone/drakboot b/perl-install/standalone/drakboot
index dd0eb6403..eb8150b2c 100755
--- a/perl-install/standalone/drakboot
+++ b/perl-install/standalone/drakboot
@@ -22,9 +22,17 @@ $::expert = /-expert/;
my $in = 'interactive'->vnew('su', 'bootloader');
-require 'bootlook.pm' if $in->isa('interactive_gtk');
-lilo_choice();
+$::lilo_choice = \&lilo_choice;
+if ($in->isa('interactive_gtk')) {
+ require 'bootlook.pm';
+} else {
+ lilo_choice();
+}
+
+!$::isEmbedded and $in->exit(0);
+kill(USR1, $::CCPID);
+goto ask;
sub lilo_choice
{
@@ -33,13 +41,14 @@ sub lilo_choice
$bootloader->{methods} = { lilo => 1, grub => !!/grub/i };
my ($all_hds) = catch_cdie { fsedit::hds([ detect_devices::hds() ], {}) } sub { 1 };
- my $fstab = [ fsedit::get_all_fstab(@$all_hds) ];
+ my $fstab = [ fsedit::get_all_fstab($all_hds) ];
fs::merge_info_from_fstab($fstab);
-
+
$::expert=1;
ask:
- any::setupBootloader($in, $bootloader, $all_hds, $fstab, $ENV{SECURE_LEVEL}) or $in->exit(0);
+ local $::isEmbedded = 0;
+ any::setupBootloader($in, $bootloader, $all_hds, $fstab, $ENV{SECURE_LEVEL}) or return;
eval { bootloader::install('', $bootloader, $fstab, $all_hds->{hds}) };
if ($@) {
@@ -50,7 +59,3 @@ sub lilo_choice
goto ask;
}
}
- !$::isEmbedded and $in->exit(0);
- kill(USR1, $::CCPID);
- goto ask;
-