summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakboot
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-03-30 23:25:44 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-03-30 23:25:44 +0000
commit75bcbea29b0dba1954344cc78b9ecb75e5007bfa (patch)
tree83d0669e2cdcb66caceb134e88f05179c99a6b55 /perl-install/standalone/drakboot
parent0ed09587c155ff3297d723d038a9e3016d1d599e (diff)
downloaddrakx-75bcbea29b0dba1954344cc78b9ecb75e5007bfa.tar
drakx-75bcbea29b0dba1954344cc78b9ecb75e5007bfa.tar.gz
drakx-75bcbea29b0dba1954344cc78b9ecb75e5007bfa.tar.bz2
drakx-75bcbea29b0dba1954344cc78b9ecb75e5007bfa.tar.xz
drakx-75bcbea29b0dba1954344cc78b9ecb75e5007bfa.zip
no_comment
Diffstat (limited to 'perl-install/standalone/drakboot')
-rwxr-xr-xperl-install/standalone/drakboot42
1 files changed, 42 insertions, 0 deletions
diff --git a/perl-install/standalone/drakboot b/perl-install/standalone/drakboot
new file mode 100755
index 000000000..33af4079a
--- /dev/null
+++ b/perl-install/standalone/drakboot
@@ -0,0 +1,42 @@
+#!/usr/bin/perl
+
+use lib qw(/usr/lib/libDrakX);
+
+use common qw(:system :file :functional);
+use interactive;
+use any;
+use lilo;
+use detect_devices;
+use fsedit;
+use c;
+
+local $_ = join '', @ARGV;
+
+/-h/ and die "usage: drakboot\n";
+
+$::isStandalone = 1;
+
+my $in = vnew interactive('su');
+
+my $bootloader = lilo::read('', '/etc/lilo.conf');
+
+my $hds = catch_cdie { fsedit::hds([ detect_devices::hds() ], {}) } sub { 1 };
+my $fstab = [ fsedit::get_fstab(@$hds) ];
+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) };
+
+if ($err && $@) {
+ $in->ask_warn('',
+ [ _("Installation of LILO failed. The following error occured:"),
+ grep { !/^Warning:/ } cat_("/tmp/.error") ]);
+ unlink "/tmp/.error";
+ goto ask;
+}
+
+$in->exit(0);