summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-10-28 09:41:32 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-10-28 09:41:32 +0000
commitf438f4f5caf143c0c6f263e09c9702b6876b91cf (patch)
treec4195a73c64e7ed42531a8b0ca997d0fec60b544 /perl-install/install_steps.pm
parentb4a722c16e9be060fac6a9e5bb14ee43ea048163 (diff)
downloaddrakx-f438f4f5caf143c0c6f263e09c9702b6876b91cf.tar
drakx-f438f4f5caf143c0c6f263e09c9702b6876b91cf.tar.gz
drakx-f438f4f5caf143c0c6f263e09c9702b6876b91cf.tar.bz2
drakx-f438f4f5caf143c0c6f263e09c9702b6876b91cf.tar.xz
drakx-f438f4f5caf143c0c6f263e09c9702b6876b91cf.zip
no_comment
Diffstat (limited to 'perl-install/install_steps.pm')
-rw-r--r--perl-install/install_steps.pm47
1 files changed, 33 insertions, 14 deletions
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 6a5005d8e..1224d8a83 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -46,7 +46,10 @@ sub leavingStep {
my ($o, $step) = @_;
log::l("step `$step' finished");
- eval { commands::cp('-f', "/tmp/ddebug.log", "$o->{prefix}/root") } if -d "$o->{prefix}/root" && !$::testing;
+ if (-d "$o->{prefix}/root") {
+ eval { commands::cp('-f', "/tmp/ddebug.log", "$o->{prefix}/root") };
+ install_any::g_auto_install();
+ }
for (my $s = $o->{steps}{first}; $s; $s = $o->{steps}{$s}{next}) {
#- the reachability property must be recomputed each time to take
@@ -161,16 +164,16 @@ sub formatPartitions {
#------------------------------------------------------------------------------
sub setPackages {
- my ($o, $install_classes) = @_;
- install_any::setPackages($o, $install_classes);
+ my ($o) = @_;
+ install_any::setPackages($o);
}
sub selectPackagesToUpgrade {
my ($o) = @_;
install_any::selectPackagesToUpgrade($o);
}
-sub choosePackages($$$) {
- my ($o, $packages, $compss) = @_;
+sub choosePackages($$$$) {
+ my ($o, $packages, $compss, $compssUsers) = @_;
}
sub beforeInstallPackages {
@@ -223,8 +226,7 @@ sub configureNetwork($) {
network::sethostname($o->{netc}) unless $::testing;
network::addDefaultRoute($o->{netc}) unless $::testing;
- install_any::pkg_install($o, "dhcpcd") if grep { $_->{BOOTPROTO} eq "dhcp" } @{$o->{intf}};
- install_any::pkg_install($o, "pump") if grep { $_->{BOOTPROTO} eq "bootp" } @{$o->{intf}};
+ install_any::pkg_install($o, "dhcpcd") if grep { $_->{BOOTPROTO} =~ /^(dhcp|bootp)$/ } @{$o->{intf}};
#-res_init(); #- reinit the resolver so DNS changes take affect
}
@@ -264,13 +266,13 @@ sub printerConfig {
}
#------------------------------------------------------------------------------
-my @etc_pass_fields = qw(name password uid gid realname home shell);
+my @etc_pass_fields = qw(name pw uid gid realname home shell);
sub setRootPassword($) {
my ($o) = @_;
my $p = $o->{prefix};
- my %u = %{$o->{superuser} ||= {}};
+ my $u = $o->{superuser} ||= {};
- $u{password} = install_any::crypt($u{password}) if $u{password};
+ $u->{pw} ||= $u->{password} && install_any::crypt($u->{password});
my @lines = cat_(my $f = "$p/etc/passwd") or log::l("missing passwd file"), return;
@@ -280,8 +282,8 @@ sub setRootPassword($) {
if (/^root:/) {
chomp;
my %l; @l{@etc_pass_fields} = split ':';
- add2hash(\%u, \%l);
- $_ = join(':', @u{@etc_pass_fields}) . "\n";
+ add2hash($u, \%l);
+ $_ = join(':', @$u{@etc_pass_fields}) . "\n";
}
print F $_;
}
@@ -306,7 +308,9 @@ sub addUser($) {
if (!$g || getgrgid($g)) { for ($g = 500; getgrgid($g) || $gids{$g}; $g++) {} }
$_->{home} ||= "/home/$_->{name}";
- @$_{qw(uid gid pw)} = ($u, $g, $_->{password} && install_any::crypt($_->{password}));
+ $_->{uid} = $u;
+ $_->{gid} = $g;
+ $_{pw} ||= $_->{password} && install_any::crypt($_->{password});
}
my @passwd = cat_("$p/etc/passwd");;
@@ -320,7 +324,11 @@ sub addUser($) {
foreach (@l) {
if (! -d "$p$_->{home}") {
eval { commands::cp("-f", "$p/etc/skel", "$p$_->{home}") };
- if ($@) { log::l("copying of skel failed: $@"); mkdir("$p$_->{home}", 0750); }
+ if ($@) {
+ log::l("copying of skel failed: $@"); mkdir("$p$_->{home}", 0750);
+ } else {
+ chmod 0750, "$p$_->{home}";
+ }
}
commands::chown_("-r", "$_->{uid}.$_->{gid}", "$p$_->{home}")
if $_->{uid} != $_->{oldu} || $_->{gid} != $_->{oldg};
@@ -391,6 +399,17 @@ sub setupXfree {
}
#------------------------------------------------------------------------------
+sub miscellaneous {
+ my ($o) = @_;
+ setVarsInSh("$o->{prefix}/etc/sysconfig/system", {
+ LAPTOP => bool2text($o->{miscellaneous}{LAPTOP}),
+ HDPARM => $o->{miscellaneous}{HDPARM},
+ TYPE => $o->{installClass},
+ SECURITY => $o->{security},
+ });
+}
+
+#------------------------------------------------------------------------------
sub exitInstall { install_any::unlockCdroms }
#-######################################################################################