summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakboot
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone/drakboot')
-rwxr-xr-xperl-install/standalone/drakboot41
1 files changed, 32 insertions, 9 deletions
diff --git a/perl-install/standalone/drakboot b/perl-install/standalone/drakboot
index 33af4079a..b5656dc4a 100755
--- a/perl-install/standalone/drakboot
+++ b/perl-install/standalone/drakboot
@@ -2,23 +2,48 @@
use lib qw(/usr/lib/libDrakX);
-use common qw(:system :file :functional);
+use common qw(:common :file :functional);
use interactive;
use any;
-use lilo;
+use bootloader;
use detect_devices;
use fsedit;
+use fs;
use c;
local $_ = join '', @ARGV;
-/-h/ and die "usage: drakboot\n";
+/-h/ and die "usage: drakboot [--expert]\n";
+$::expert = /-expert/;
$::isStandalone = 1;
-my $in = vnew interactive('su');
+my $in = interactive->vnew('su');
-my $bootloader = lilo::read('', '/etc/lilo.conf');
+my %l = (
+ arch() !~ /sparc|alpha/ ? (
+ _("Configure LILO/GRUB") => '',
+ _("Create a boot floppy") => ['/usr/X11R6/bin/drakfloppy'],
+ ) : (),
+ _("Format floppy") => [ '/usr/bin/kfloppy', '/usr/bin/gfloppy' ],
+);
+
+while (my ($k, $v) = each %l) {
+ $v or next;
+ foreach (@$v) {
+ -x $_ and $l{$k} = $_, last;
+ }
+ -x $l{$k} or delete $l{$k};
+}
+
+if ($ENV{DISPLAY} && c::Xtest($ENV{DISPLAY})) {
+ my $cmd = $l{$in->ask_from_list(_("Choice"), _("What do you want to do?"), [ keys %l ])};
+ exec $cmd if $cmd;
+}
+
+my $bootloader = bootloader::read('', '/etc/lilo.conf');
+local ($_) = `detectloader`;
+$bootloader->{methods} = { lilo => 1, grub => !!/grub/i };
my $hds = catch_cdie { fsedit::hds([ detect_devices::hds() ], {}) } sub { 1 };
my $fstab = [ fsedit::get_fstab(@$hds) ];
@@ -27,11 +52,9 @@ fs::get_mntpoints_from_fstab($fstab);
ask:
any::setupBootloader($in, $bootloader, $hds, $fstab, $ENV{SECURE_LEVEL}) or $in->exit(0);
-eval { lilo::install('', $bootloader) };
-my $err = $@;
-eval { lilo::install_grub('', $bootloader, $fstab, $hds) };
+eval { bootloader::install('', $bootloader, $fstab, $hds) };
-if ($err && $@) {
+if ($@) {
$in->ask_warn('',
[ _("Installation of LILO failed. The following error occured:"),
grep { !/^Warning:/ } cat_("/tmp/.error") ]);