summaryrefslogtreecommitdiffstats
path: root/installer/OpenSLX/OSSetup/Engine.pm
diff options
context:
space:
mode:
authorOliver Tappe2007-04-26 20:01:30 +0200
committerOliver Tappe2007-04-26 20:01:30 +0200
commit8a355327d25ee3aa29e88b5d8977e35378fcb1a7 (patch)
treec80fa7dc5ae721aa5147fc1d438d711c2266dc8f /installer/OpenSLX/OSSetup/Engine.pm
parent* fixed problem in slxsystem that would cause unexpected exits if any (diff)
downloadcore-8a355327d25ee3aa29e88b5d8977e35378fcb1a7.tar.gz
core-8a355327d25ee3aa29e88b5d8977e35378fcb1a7.tar.xz
core-8a355327d25ee3aa29e88b5d8977e35378fcb1a7.zip
* cleaned up handling of busybox binary, we now copy the binary that corresponds
to the host system (32-bit or 64-bit). Let's see if that improves the result on debian-4... git-svn-id: http://svn.openslx.org/svn/openslx/trunk@930 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'installer/OpenSLX/OSSetup/Engine.pm')
-rw-r--r--installer/OpenSLX/OSSetup/Engine.pm59
1 files changed, 38 insertions, 21 deletions
diff --git a/installer/OpenSLX/OSSetup/Engine.pm b/installer/OpenSLX/OSSetup/Engine.pm
index d2feebd5..f829e3ba 100644
--- a/installer/OpenSLX/OSSetup/Engine.pm
+++ b/installer/OpenSLX/OSSetup/Engine.pm
@@ -168,7 +168,7 @@ sub installVendorOS
$self->setupStage1A();
executeInSubprocess( sub {
# some tasks that involve a chrooted environment:
- changePersonalityIfNeeded($self->{distro}->{'base-name'});
+ $self->changePersonalityIfNeeded();
$self->setupStage1B();
$self->setupStage1C();
});
@@ -178,7 +178,7 @@ sub installVendorOS
}
executeInSubprocess( sub {
# another task that involves a chrooted environment:
- changePersonalityIfNeeded($self->{distro}->{'base-name'});
+ $self->changePersonalityIfNeeded();
$self->setupStage1D();
});
slxsystem("touch $installInfoFile");
@@ -260,7 +260,7 @@ sub updateVendorOS
$self->{'vendor-os-path'});
}
executeInSubprocess( sub {
- changePersonalityIfNeeded($self->{distro}->{'base-name'});
+ $self->changePersonalityIfNeeded();
$self->updateStage1D();
});
vlog 0, _tr("Vendor-OS '%s' updated succesfully.\n",
@@ -456,8 +456,12 @@ sub stage1A_createBusyboxEnvironment
# copy busybox and all required binaries into stage1a-dir:
vlog 1, "creating busybox-environment...";
- copyFile("$openslxConfig{'share-path'}/busybox/busybox",
- "$self->{stage1aDir}/bin");
+ my $busyboxName
+ = $self->hostIs64Bit()
+ ? 'busybox.x86_64'
+ : 'busybox.i586';
+ copyFile("$openslxConfig{'share-path'}/busybox/$busyboxName",
+ "$self->{stage1aDir}/bin", 'busybox');
# determine all required libraries and copy those, too:
vlog 2, "calling slxldd for busybox";
@@ -717,6 +721,8 @@ sub stage1D_updateBasicVendorOS()
chroot "."
or die _tr("unable to chroot into '%s' (%s)\n", $osDir, $!);
+ $ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin";
+
vlog 1, "updating basic vendor-os...";
$self->{'meta-packager'}->startSession();
$self->{'meta-packager'}->updateBasicVendorOS();
@@ -799,6 +805,33 @@ sub removeVendorOSFromConfigDB
}
################################################################################
+### utility methods
+################################################################################
+sub changePersonalityIfNeeded {
+ my $self = shift;
+
+ my $distroName = $self->{distro}->{'base-name'};
+ if ($self->hostIs64Bit() && $distroName !~ m[_64]) {
+ # trying to handle a 32-bit vendor-OS on a 64-bit machine, so we change
+ # the personality accordingly (from 64-bit to 32-bit):
+ require 'syscall.ph'
+ or die _tr("unable to load '%s'\n", 'syscall.ph');
+ require 'linux/personality.ph'
+ or die _tr("unable to load '%s'\n", 'linux/personality.ph');
+ no strict;
+ syscall &SYS_personality, PER_LINUX32();
+ }
+}
+
+sub hostIs64Bit
+{
+ my $self = shift;
+
+ $self->{arch} = `uname -m` unless defined $self->{arch};
+ return ($self->{arch} =~ m[64]);
+}
+
+################################################################################
### utility functions
################################################################################
sub string2Array
@@ -845,22 +878,6 @@ retry:
return @foundFiles;
}
-sub changePersonalityIfNeeded {
- my $distroName = shift;
-
- my $arch = `uname -m`;
- if ($arch =~ m[64] && $distroName !~ m[_64]) {
- # trying to handle a 32-bit vendor-OS on a 64-bit machine, so we change
- # the personality accordingly (from 64-bit to 32-bit):
- require 'syscall.ph'
- or die _tr("unable to load '%s'\n", 'syscall.ph');
- require 'linux/personality.ph'
- or die _tr("unable to load '%s'\n", 'linux/personality.ph');
- no strict;
- syscall &SYS_personality, PER_LINUX32();
- }
-}
-
1;
################################################################################