diff options
author | Oliver Tappe | 2008-03-23 16:18:42 +0100 |
---|---|---|
committer | Oliver Tappe | 2008-03-23 16:18:42 +0100 |
commit | 112bbb1bf3d2d7f1fd66fa6f8e558744d0784226 (patch) | |
tree | 03642fcd7116844c455ef6945eace64e170138cd /installer/OpenSLX/OSSetup/Engine.pm | |
parent | * added sigtrap protection (against user pressing CTRL-C, for instance) and made (diff) | |
download | core-112bbb1bf3d2d7f1fd66fa6f8e558744d0784226.tar.gz core-112bbb1bf3d2d7f1fd66fa6f8e558744d0784226.tar.xz core-112bbb1bf3d2d7f1fd66fa6f8e558744d0784226.zip |
* moved syscall related code into a module of its own right
* activated mounting of /proc again in startSession() and finishSession(),
this time in a more robust fashion (which tries hard to unmount it again)
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1677 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'installer/OpenSLX/OSSetup/Engine.pm')
-rw-r--r-- | installer/OpenSLX/OSSetup/Engine.pm | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/installer/OpenSLX/OSSetup/Engine.pm b/installer/OpenSLX/OSSetup/Engine.pm index 9030beaa..9518c74a 100644 --- a/installer/OpenSLX/OSSetup/Engine.pm +++ b/installer/OpenSLX/OSSetup/Engine.pm @@ -31,6 +31,7 @@ use File::Basename; use URI; use OpenSLX::Basics; +use OpenSLX::Syscall; use OpenSLX::Utils; use vars qw(%supportedDistros); @@ -1521,8 +1522,13 @@ sub _setupStage1D $self->_stage1D_setupPackageSources(); $self->_stage1D_updateBasicVendorOS(); $self->{distro}->preSystemInstallationHook(); - $self->_stage1D_installPackageSelection(); + my $ok = eval { + $self->_stage1D_installPackageSelection(); + 1; + }; + my $err = $ok ? undef : $@; $self->{distro}->postSystemInstallationHook(); + die $err if defined $err; }, updateConfig => 1, }); @@ -1576,7 +1582,7 @@ sub _callChrootedFunction 'updateConfig' => '?', }); - $self->{'distro'}->startSession($params->{chrootDir}); + $self->{distro}->startSession($params->{chrootDir}); # invoke given function: $params->{function}->(); @@ -1757,36 +1763,11 @@ sub _changePersonalityIfNeeded my $distroName = $self->{'distro-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): - $self->_loadPerlHeader('syscall.ph') - or die _tr("unable to load perl header '%s'\n", 'syscall.ph'); - $self->_loadPerlHeader('linux/personality.ph') - || $self->_loadPerlHeader('sys/personality.ph') - or die _tr("unable to load perl header '%s'\n", 'personality.ph'); - - syscall &SYS_personality, PER_LINUX32(); + OpenSLX::Syscall->enter32BitPersonality(); } return; } -sub _loadPerlHeader -{ - my $self = shift; - my $phFile = shift; - - if (!eval { require $phFile }) { - # perl-header has not been provided by host-OS, so we create it - # manually from C-header (via h2ph): - (my $hFile = $phFile) =~ s{\.ph$}{.h}; - return if !-e "/usr/include/$hFile"; - my $libDir = "$openslxConfig{'base-path'}/lib"; - slxsystem("cd /usr/include && h2ph -d $libDir $hFile") == 0 - or die _tr("unable to create %s! (%s)", $phFile, $!); - } - return eval { require $phFile; 1 }; -} - sub _hostIs64Bit { my $self = shift; |