From 4047e52beb10ff604d1564bfc29e7672aac87b8c Mon Sep 17 00:00:00 2001 From: Sebastian Schmelzer Date: Tue, 12 May 2009 12:14:18 +0000 Subject: remove old busybox stuff git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2851 95ad53e4-c205-0410-b2fa-d234c58c8868 --- installer/OpenSLX/OSSetup/Distro/Base.pm | 2 +- installer/OpenSLX/OSSetup/Distro/Suse.pm | 2 +- installer/OpenSLX/OSSetup/Engine.pm | 71 +++++------------------- installer/OpenSLX/OSSetup/MetaPackager/zypper.pm | 11 +++- 4 files changed, 27 insertions(+), 59 deletions(-) (limited to 'installer/OpenSLX') diff --git a/installer/OpenSLX/OSSetup/Distro/Base.pm b/installer/OpenSLX/OSSetup/Distro/Base.pm index b511ec9d..75979ac6 100644 --- a/installer/OpenSLX/OSSetup/Distro/Base.pm +++ b/installer/OpenSLX/OSSetup/Distro/Base.pm @@ -292,7 +292,7 @@ sub hashPassword my $self = shift; my $password = shift; - my $busyboxBin = $self->{engine}->{'busybox-binary'}; + my $busyboxBin = $self->{engine}->busyboxBinary(); my $hashedPassword = qx{$busyboxBin cryptpw -a md5 $password}; chomp $hashedPassword; diff --git a/installer/OpenSLX/OSSetup/Distro/Suse.pm b/installer/OpenSLX/OSSetup/Distro/Suse.pm index e8e1c7c8..8e85e46a 100644 --- a/installer/OpenSLX/OSSetup/Distro/Suse.pm +++ b/installer/OpenSLX/OSSetup/Distro/Suse.pm @@ -88,7 +88,7 @@ sub hashPassword my $self = shift; my $password = shift; - my $busyboxBin = $self->{engine}->{'busybox-binary'}; + my $busyboxBin = $self->{engine}->busyboxBinary(); my $hashedPassword = qx{$busyboxBin cryptpw -a blowfish '$password'}; chomp $hashedPassword; diff --git a/installer/OpenSLX/OSSetup/Engine.pm b/installer/OpenSLX/OSSetup/Engine.pm index 6cb0cf2c..74a5ed7e 100644 --- a/installer/OpenSLX/OSSetup/Engine.pm +++ b/installer/OpenSLX/OSSetup/Engine.pm @@ -168,14 +168,7 @@ sub initialize ); } $self->{'config-distro-info-dir'} = $configDistroInfoDir; - - my $busyboxName = - $self->_hostIs64Bit() - ? 'busybox.x86_64' - : 'busybox.i586'; - $self->{'busybox-binary'} - = "$openslxConfig{'base-path'}/share/busybox/$busyboxName"; - + my $setupMirrorsIfNecessary = $actionType eq 'install'; $self->_readDistroInfo($setupMirrorsIfNecessary); } @@ -672,8 +665,14 @@ sub getInstallablePackagesForSelection sub busyboxBinary { my $self = shift; + + my $uclibdir = "$openslxConfig{'base-path'}/share/uclib-rootfs"; - return $self->{'busybox-binary'}; + return sprintf( + "LD_LIBRARY_PATH=%s/lib %s/bin/busybox", + $uclibdir, + $uclibdir + ); } ################################################################################ @@ -964,8 +963,8 @@ sub _speedTestMirror } # now measure the time it takes to download the file - my $wgetCmd - = "$self->{'busybox-binary'} wget -q -O - $mirror/$file >/dev/null"; + my $wgetCmd = $self->busyboxBinary(); + $wgetCmd .= " wget -q -O - $mirror/$file >/dev/null"; my $start = time(); if (slxsystem($wgetCmd)) { # just return any large number that is unlikely to be selected @@ -1216,7 +1215,7 @@ sub _startLocalURLServersAsNeeded if (!exists $localHttpServers{$localURL}) { my $pid = executeInSubprocess( - $self->{'busybox-binary'}, "httpd", '-p', $port, '-h', '/', '-f' + $self->busyboxBinary(), "httpd", '-p', $port, '-h', '/', '-f' ); vlog(1, _tr( @@ -1265,7 +1264,6 @@ sub _setupStage1A $stage1cDir, $!); } - #$self->_stage1A_createBusyboxEnvironment(); $self->_stage1A_setupUclibcEnvironment(); $self->_stage1A_copyPrerequiredFiles(); $self->_stage1A_copyTrustedPackageKeys(); @@ -1288,54 +1286,15 @@ sub _stage1A_setupUclibcEnvironment } -sub _stage1A_createBusyboxEnvironment -{ - my $self = shift; - - # copy busybox and all required binaries into stage1a-dir: - vlog(1, "creating busybox-environment..."); - my $requiredLibs = copyBinaryWithRequiredLibs({ - 'binary' => $self->{'busybox-binary'}, - 'targetFolder' => "$self->{stage1aDir}/bin", - 'libTargetFolder' => $self->{stage1aDir}, - 'targetName' => 'busybox', - }); - my $libcFolder; - foreach my $lib (split "\n", $requiredLibs) { - if ($lib =~ m[/libc.so.\d\s*$]) { - # note target folder of libc, as we need to copy the resolver libs - # into the same place: - $libcFolder = dirname($lib); - } - } - - # create all needed links to busybox: - my @busyboxApplets = getAvailableBusyboxApplets($self->{'busybox-binary'}); - foreach my $linkTarget (@busyboxApplets) { - linkFile('/bin/busybox', "$self->{stage1aDir}/$linkTarget"); - } - if ($self->_hostIs64Bit()) { - if (!-e "$self->{stage1aDir}/lib64") { - linkFile('/lib', "$self->{stage1aDir}/lib64"); - } - if (!-e "$self->{stage1aDir}/usr/lib64") { - linkFile('/usr/lib', "$self->{stage1aDir}/usr/lib64"); - } - } - - $self->_stage1A_setupResolver($libcFolder); - return; -} - sub _stage1A_setupResolver { my $self = shift; my $libcFolder = shift; - if (!defined $libcFolder) { - warn _tr("unable to determine libc-target-folder, will use /lib!"); - $libcFolder = '/lib'; - } + #if (!defined $libcFolder) { + # warn _tr("unable to determine libc-target-folder, will use /lib!"); + # $libcFolder = '/lib'; + #} copyFile('/etc/resolv.conf', "$self->{stage1aDir}/etc"); copyFile('/etc/nsswitch.conf', "$self->{stage1aDir}/etc"); diff --git a/installer/OpenSLX/OSSetup/MetaPackager/zypper.pm b/installer/OpenSLX/OSSetup/MetaPackager/zypper.pm index 805c9ea0..4bb22bde 100644 --- a/installer/OpenSLX/OSSetup/MetaPackager/zypper.pm +++ b/installer/OpenSLX/OSSetup/MetaPackager/zypper.pm @@ -54,10 +54,19 @@ sub setupPackageSource my $repoURLs = shift; my $repoSubdir = ''; - if (length($repoInfo->{'repo-subdir'})) { + if (defined $repoInfo->{'repo-subdir'} && + length($repoInfo->{'repo-subdir'})) { $repoSubdir = "/$repoInfo->{'repo-subdir'}"; } my $baseURL = shift @$repoURLs; + + if ($baseURL =~ m/non-oss/) { + # skip non-oss repositories, cause zypper can't realy handle them + # correctly; zypper is deacting them with following message: + # "Repository type can't be determined." + return 1; + } + if (slxsystem("zypper addrepo $baseURL$repoSubdir $repoName")) { die _tr("unable to add repo '%s' (%s)\n", $repoName, $!); } -- cgit v1.2.3-55-g7522