diff options
Diffstat (limited to 'perl-install/standalone/drakboot')
| -rwxr-xr-x | perl-install/standalone/drakboot | 78 |
1 files changed, 36 insertions, 42 deletions
diff --git a/perl-install/standalone/drakboot b/perl-install/standalone/drakboot index 8a17b4813..b4fa43a98 100755 --- a/perl-install/standalone/drakboot +++ b/perl-install/standalone/drakboot @@ -1,56 +1,50 @@ #!/usr/bin/perl +# DrakBoot +# Copyright (C) 2001-2008 Mandriva +# Yves Duret, Thierry Vignaud +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +use strict; +use diagnostics; use lib qw(/usr/lib/libDrakX); - +use standalone; #- warning, standalone must be loaded very first, for 'explanations' use common; use interactive; -use standalone; use any; use bootloader; -use detect_devices; use fsedit; use fs; -use c; - -$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/; -local $_ = join '', @ARGV; - -/-h/ and die "usage: drakboot [--expert]\n"; - -$::expert = /-expert/; - -my $in = 'interactive'->vnew('su', 'bootloader'); - -require 'bootlook.pm' if $in->isa('interactive_gtk'); -lilo_choice(); - -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: - any::setupBootloader($in, $bootloader, $all_hds, $fstab, $ENV{SECURE_LEVEL}) or $in->exit(0); - eval { bootloader::install('', $bootloader, $fstab, $all_hds->{hds}) }; +my $in = 'interactive'->vnew('su'); - if ($@) { - $in->ask_warn('', - [ _("Installation of LILO failed. The following error occured:"), - grep { !/^Warning:/ } cat_("/tmp/.error") ]); - unlink "/tmp/.error"; - goto ask; - } +my $all_hds = fsedit::get_hds(); +fs::get_raw_hds('', $all_hds); +fs::get_info_from_fstab($all_hds); +my $fstab = [ fs::get::fstab($all_hds) ]; +my $bootloader = bootloader::read($all_hds); +if (!$bootloader) { + $in->ask_okcancel('', N("No bootloader found, creating a new configuration"), 0) or $in->exit; + any::setupBootloaderBeforeStandalone($in->do_pkgs, $bootloader ||= {}, $all_hds, $fstab); } - !$::isEmbedded and $in->exit(0); - kill(USR1, $::CCPID); - goto ask; +$::isWizard = 1; +require security::level; +my $level = security::level::from_string(security::level::get()); +eval { any::setupBootloaderUntilInstalled($in, $bootloader, $all_hds, $fstab, $level) }; +die if $@ && $@ !~ /^wizcancel/; +$in->exit(0); |
