summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/install2.pm22
-rw-r--r--perl-install/install_any.pm11
-rw-r--r--perl-install/install_steps.pm14
-rw-r--r--perl-install/timezone.pm9
4 files changed, 31 insertions, 25 deletions
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index eb2be4e7e..1345f0ae2 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -50,9 +50,8 @@ my (%installSteps, @orderedInstallSteps);
installPackages => [ __("Install system"), 1, -1, '', ["formatPartitions", "selectInstallClass"] ],
configureNetwork => [ __("Configure networking"), 1, 1, '', "formatPartitions" ],
#- installCrypto => [ __("Cryptographic"), 1, 1, '!$::expert', "configureNetwork" ],
- configureTimezone => [ __("Configure timezone"), 1, 1, '', "installPackages" ],
+ summary => [ __("Summary"), 1, 0, '', "installPackages" ],
configureServices => [ __("Configure services"), 1, 1, '!$::expert', "installPackages" ],
- configurePrinter => [ __("Configure printer"), 1, 0, '', "installPackages" ],
setRootPassword => [ __("Set root password"), 1, 1, '', "installPackages" ],
addUser => [ __("Add a user"), 1, 1, '', "installPackages" ],
arch() !~ /alpha/ ? (
@@ -362,6 +361,8 @@ VISOR=no
}
#------------------------------------------------------------------------------
+sub summary { $o->summary($_[1] == 1) }
+#------------------------------------------------------------------------------
sub configureNetwork {
#- get current configuration of network device.
require network;
@@ -371,25 +372,8 @@ sub configureNetwork {
#------------------------------------------------------------------------------
sub installCrypto { $o->installCrypto }
#------------------------------------------------------------------------------
-sub configureTimezone {
- my ($clicked) = @_;
- my $f = "$o->{prefix}/etc/sysconfig/clock";
-
- require timezone;
- if ($o->{isUpgrade} && -r $f && -s $f > 0) {
- return if $_[1] == 1 && !$clicked;
- #- can't be done in install cuz' timeconfig %post creates funny things
- add2hash($o->{timezone}, { timezone::read($f) });
- }
- $o->{timezone}{timezone} ||= timezone::bestTimezone(lang::lang2text($o->{lang}));
- $o->{timezone}{UTC} = $::expert && !grep { isFat($_) || isNT($_) } @{$o->{fstab}} unless exists $o->{timezone}{UTC};
- $o->configureTimezone($clicked);
-}
-#------------------------------------------------------------------------------
sub configureServices { $::expert and $o->configureServices }
#------------------------------------------------------------------------------
-sub configurePrinter { $o->configurePrinter($_[0]) }
-#------------------------------------------------------------------------------
sub setRootPassword {
return if $o->{isUpgrade};
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 1094d82a1..4f9d02047 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -276,6 +276,17 @@ sub getAvailableSpace_raw {
die "missing root partition";
}
+sub preConfigureTimezone {
+ my ($o) = @_;
+ require timezone;
+
+ #- can't be done in install cuz' timeconfig %post creates funny things
+ add2hash($o->{timezone}, { timezone::read() }) if $o->{isUpgrade};
+
+ $o->{timezone}{timezone} ||= timezone::bestTimezone(lang::lang2text($o->{lang}));
+ add2hash_($o->{timezone}, { UTC => $::expert && !grep { isFat($_) || isNT($_) } @{$o->{fstab}} });
+}
+
sub setPackages {
my ($o) = @_;
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index a3fb7f72f..26c55950e 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -497,9 +497,17 @@ sub installCrypto {
$o->pkg_install(@{$u->{packages}});
}
+sub summary {
+ my ($o) = @_;
+ configureTimezone($o);
+ configurePrinter($o);
+}
+
#------------------------------------------------------------------------------
sub configureTimezone {
my ($o) = @_;
+ install_any::preConfigureTimezone($o);
+
require timezone;
timezone::write($o->{prefix}, $o->{timezone});
}
@@ -507,8 +515,10 @@ sub configureTimezone {
#------------------------------------------------------------------------------
sub configureServices {
my ($o) = @_;
- require services;
- services::doit($o, $o->{services}, $o->{prefix}) if $o->{services};
+ if ($o->{services}) {
+ require services;
+ services::doit($o, $o->{services}, $o->{prefix});
+ }
}
#------------------------------------------------------------------------------
sub configurePrinter {
diff --git a/perl-install/timezone.pm b/perl-install/timezone.pm
index 96fb0510e..cd0486138 100644
--- a/perl-install/timezone.pm
+++ b/perl-install/timezone.pm
@@ -17,11 +17,12 @@ sub getTimeZones {
@l;
}
-sub read ($) {
- my ($f) = @_;
- my %t = getVarsFromSh($f) or die "cannot open file $f: $!";
+sub read {
+ my ($prefix) = @_;
+ my $f = "$prefix/etc/sysconfig/clock";
+ my %t = getVarsFromSh($f) or return;
- ("timezone", $t{ZONE}, "UTC", text2bool($t{UTC}));
+ (timezone => $t{ZONE}, UTC => text2bool($t{UTC}));
}
sub write {