summaryrefslogtreecommitdiffstats
path: root/perl-install/install/install2.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/install/install2.pm')
-rw-r--r--perl-install/install/install2.pm87
1 files changed, 85 insertions, 2 deletions
diff --git a/perl-install/install/install2.pm b/perl-install/install/install2.pm
index a12954d23..5d7c21f27 100644
--- a/perl-install/install/install2.pm
+++ b/perl-install/install/install2.pm
@@ -9,7 +9,30 @@ BEGIN { $::isInstall = 1 }
=head1 SYNOPSYS
-The installer stage2 real entry point
+The installer stage2 real entry point.
+This module implements the main loop execution of DrakX:
+
+=over 4
+
+=item * parse command line arguments,
+
+=item * prepare installation,
+
+=item * find the right install/interactive class according to command line,
+
+=item * check memory available and if the interactive chosen is initializing correctly,
+
+=item * else it will try a less-demanding interactive object.
+
+=item * Once done, $::o is set to this install & interactive object
+and main runs the various step of install2 defined in $o->{steps},
+starting with $o->{steps}{first} and iterating with method
+install::any::getNextStep(). while running step,
+
+=item * it trap any errors that may arise and use perl exception to
+change step.
+
+=back
=cut
@@ -105,6 +128,10 @@ $o = $::o = {
=over
+=item installStepsCall($o, $auto, $fun, @args)
+
+Call the $fun step. It's used by the various step stubs below.
+
=cut
sub installStepsCall {
@@ -427,10 +454,14 @@ sub stop_udev() {
=back
-=head1 Other Functions
+=head1 Other Functions: main() and its helpers
=over
+=item init_local_install($o)
+
+Initialize the DrakX installer for a local install (eg: using ../tools/drakx-in-chroot)
+
=cut
#-######################################################################################
@@ -445,6 +476,13 @@ sub init_local_install {
$o->{mouse} = mouse::fullname2mouse('Universal|Any PS/2 & USB mice');
}
+=item pre_init_brltty()
+
+Check for any "brltty=" parameter on the kernel command line and set up the parameters accordingly.
+
+=cut
+
+
sub pre_init_brltty() {
if (my ($s) = cat_("/proc/cmdline") =~ /brltty=(\S*)/) {
my ($driver, $device, $table) = split(',', $s);
@@ -456,12 +494,27 @@ sub pre_init_brltty() {
}
}
+=item init_brltty()
+
+Actually starts brltty if needed.
+
+=cut
+
sub init_brltty() {
symlink "/tmp/stage2/$_", $_ foreach "/etc/brltty";
devices::make($_) foreach $o->{brltty}{device};
run_program::run("brltty");
}
+
+=item init_auto_install()
+
+Set up the auto installation if the proper parameter was passed on the kernel command line.
+That means retrieving the auto install file.
+
+=cut
+
+
sub init_auto_install() {
if ($::auto_install =~ /-IP(\.pl)?$/) {
my ($ip) = cat_('/tmp/stage1.log') =~ /configuring device (?!lo)\S+ ip: (\S+)/;
@@ -487,6 +540,29 @@ sub init_auto_install() {
}
}
+=item step_init($o)
+
+Initialize the proper steps backend (auto, text or graphical).
+If it fails to initialize, the installer will default to text mode ("ncurses").
+
+The default is "gtk"
+
+The various modes are:
+
+=over 4
+
+=item * "auto" (the automatic mode - but some steps can be specified as interactive)
+
+=item * "gtk" (the default graphical mode unless specified otherwise or unless there's not enough memory)
+
+=item * "interactive" (the text mode, which can be choosen by either the "newt" or "text" options)
+
+=item * "stdio" (an alternative text mode
+
+=back
+
+=cut
+
sub step_init {
my ($o) = @_;
my $o_;
@@ -521,6 +597,13 @@ sub read_product_id() {
}->{$o->{product_id}{product}} || 'download';
}
+=item sig_segv_handler() {
+
+Handle a segmentation fault in the installer.
+
+=cut
+
+
sub sig_segv_handler() {
my $msg = "segmentation fault: install crashed (maybe memory is missing?)\n" . backtrace();
log::l("$msg\n");