1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
![]() |
index : drakx | |
Mageia Installer and base platform for many utilities | Thierry Vignaud [tv] |
summaryrefslogtreecommitdiffstats |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
package install_steps; # $Id$
use diagnostics;
use strict;
use vars qw(@filesToSaveForUpgrade @filesNewerToUseAfterUpgrade @ISA);
#-######################################################################################
#- misc imports
#-######################################################################################
use common;
use install_any qw(:all);
use partition_table qw(:types);
use detect_devices;
use modules;
use run_program;
use lang;
use keyboard;
use fsedit;
use loopback;
use pkgs;
use any;
use log;
use fs;
@filesToSaveForUpgrade = qw(
/etc/ld.so.conf /etc/fstab /etc/hosts /etc/conf.modules /etc/modules.conf
);
@filesNewerToUseAfterUpgrade = qw(
/etc/profile
);
#-######################################################################################
#- OO Stuff
#-######################################################################################
sub new($$) {
my ($type, $o) = @_;
bless $o, ref $type || $type;
return $o;
}
#-######################################################################################
#- In/Out Steps Functions
#-######################################################################################
sub enteringStep {
my ($o, $step) = @_;
log::l("starting step `$step'");
}
sub leavingStep {
my ($o, $step) = @_;
log::l("step `$step' finished");
if (-d "$o->{prefix}/root/drakx") {
eval { cp_af("/tmp/ddebug.log", "$o->{prefix}/root/drakx") };
output(install_any::auto_inst_file(), install_any::g_auto_install(1));
}
for (my $s = $o->{steps}{first}; $s; $s = $o->{steps}{$s}{next}) {
#- the reachability property must be recomputed each time to take
#- into account failed step.
next if $o->{steps}{$s}{done} && !$o->{steps}{$s}{redoable};
my $reachable = 1;
if (my $needs = $o->{steps}{$s}{needs}) {
my @l = ref $needs ? @$needs : $needs;
$reachable = min(map { $o->{steps}{$_}{done} || 0 } @l);
}
$o->{steps}{$s}{reachable} = 1 if $reachable;
}
$o->{steps}{$step}{reachable} = $o->{steps}{$step}{redoable};
while (my $f = shift @{$o->{steps}{$step}{toBeDone} || []}) {
eval { &$f() };
$o->ask_warn(_("Error"), [
_("An error occurred, but I don't know how to handle it nicely.
Continue at your own risk."), $@ ]) if $@;
}
}
sub errorInStep($$) { print "error :(\n"; c::_exit(1) }
sub kill_action {}
sub set_help { 1 }
#-######################################################################################
#- Steps Functions
#-######################################################################################
#------------------------------------------------------------------------------
sub selectLanguage {
my ($o) = @_;
lang::set($o->{lang}, !$o->isa('interactive::gtk'));
$o->{langs} ||= { $o->{lang} => 1 };
log::l("selectLanguage: pack_langs ", lang::pack_langs($o->{langs}));
#- for auto_install compatibility with old $o->{keyboard} containing directly $o->{keyboard}{KEYBOARD}
$o->{keyboard} = { KEYBOARD => $o->{keyboard} } if $o->{keyboard} && !ref($o->{keyboard});
if (!$o->{keyboard} || $o->{keyboard}{unsafe}) {
$o->{keyboard} = keyboard::from_usb() || keyboard::lang2keyboard($o->{lang});
$o->{keyboard}{unsafe} = 1;
keyboard::setup($o->{keyboard}) if !$::live;
}
addToBeDone {
lang::write_langs($o->{prefix}, $o->{langs});
} 'formatPartitions' unless $::g_auto_install;
addToBeDone {
lang::write($o->{prefix}, $o->{lang});
} 'installPackages' unless $::g_auto_install;
}
#------------------------------------------------------------------------------
sub selectKeyboard {
my ($o) = @_;
$o->{keyboard}{KBCHARSET} = lang::lang2charset($o->{lang});
keyboard::setup($o->{keyboard});
addToBeDone {
keyboard::write($o->{keyboard});
} 'installPackages' if !$::g_auto_install && (!$o->{isUpgrade} || !$o->{keyboard}{unsafe});
}
#------------------------------------------------------------------------------
sub acceptLicence {}
sub selectPath {}
#------------------------------------------------------------------------------
sub selectInstallClass {}
#------------------------------------------------------------------------------
sub setupSCSI {
my ($o) = @_;
modules::configure_pcmcia($o->{pcmcia}) if $o->{pcmcia};
modules::load_ide();
modules::load_category('bus/firewire');
modules::load_category('disk/scsi|hardware_raid');
}
#------------------------------------------------------------------------------
sub doPartitionDisksBefore {
my ($o) = @_;