From b385455b18ec7ada8ec8c9c5cc467fcf46bb5dfc Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Wed, 26 Sep 2007 11:05:33 +0000 Subject: * fixed problems with respect to installation of prerequired packages * added support for setting the root-password: + slxos-setup now queries for the root-password + 'busybox cryptpw' is used to determine the hashed password as required by the specific distribution (MD5 or Blowfish) git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1349 95ad53e4-c205-0410-b2fa-d234c58c8868 --- installer/OpenSLX/OSSetup/Engine.pm | 45 ++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) (limited to 'installer/OpenSLX/OSSetup/Engine.pm') diff --git a/installer/OpenSLX/OSSetup/Engine.pm b/installer/OpenSLX/OSSetup/Engine.pm index 46bccc75..a3092b24 100644 --- a/installer/OpenSLX/OSSetup/Engine.pm +++ b/installer/OpenSLX/OSSetup/Engine.pm @@ -263,6 +263,7 @@ sub initialize sub installVendorOS { my $self = shift; + my $vendorOSSettings = shift; my $installInfoFile = "$self->{'vendor-os-path'}/.openslx-install-info"; if (-e $installInfoFile) { @@ -301,11 +302,16 @@ sub installVendorOS ); # create the install-info file, in order to indicate a proper installation: - spitFile($installInfoFile, - "SLX_META_PACKAGER=$self->{distro}->{'meta-packager-type'}\n"); + spitFile( + $installInfoFile, + "SLX_META_PACKAGER=$self->{distro}->{'meta-packager-type'}\n" + ); + + # base system info file is no longer needed, we have a full system now slxsystem("rm $baseSystemFile"); - # no longer needed, we have a full system now + $self->_applyVendorOSSettings($vendorOSSettings) unless !$vendorOSSettings; + vlog( 0, _tr( @@ -950,6 +956,22 @@ sub _expandSelection return; } +sub _applyVendorOSSettings +{ + my $self = shift; + my $vendorOSSettings = shift; + + if (exists $vendorOSSettings->{'root-password'}) { + # hashes password according to requirements of current distro and + # writes it to /etc/shadow + $self->{distro}->setPasswordForUser( + 'root', $vendorOSSettings->{'root-password'} + ); + } + + return; +} + sub _createVendorOSPath { my $self = shift; @@ -1320,7 +1342,12 @@ sub _stage1B_chrootAndBootstrap ); $self->{'baseURL-index'} = 0; my @pkgs = string2Array($self->{'distro-info'}->{'prereq-packages'}); + vlog( + 2, + "downloading these prereq packages:\n\t" . join("\n\t", @pkgs) + ); my @prereqPkgs = $self->_downloadBaseFiles(\@pkgs); + $self->{'prereq-packages'} = \@prereqPkgs; $self->{packager}->bootstrap(\@prereqPkgs); @pkgs = string2Array($self->{'distro-info'}->{'bootstrap-packages'}); @@ -1328,9 +1355,13 @@ sub _stage1B_chrootAndBootstrap @pkgs, string2Array( $self->{'distro-info'}->{'metapackager'} - ->{$self->{distro}->{'meta-packager-type'}} + ->{$self->{distro}->{'meta-packager-type'}}->{packages} ) ); + vlog( + 2, + "downloading bootstrap packages:\n\t" . join("\n\t", @pkgs) + ); my @bootstrapPkgs = $self->_downloadBaseFiles(\@pkgs); $self->{'bootstrap-packages'} = \@bootstrapPkgs; }, @@ -1368,7 +1399,11 @@ sub _stage1C_chrootAndInstallBasicVendorOS $self->{packager}->importTrustedPackageKeys(\@keyFiles, $stage1cDir); } - # install all bootstrap packages + # install prerequired packages (if distro requires it) + $self->{packager}->installPrerequiredPackages( + $self->{'prereq-packages'}, $stage1cDir + ); + # install bootstrap packages $self->{packager}->installPackages( $self->{'bootstrap-packages'}, $stage1cDir ); -- cgit v1.2.3-55-g7522