From 112bbb1bf3d2d7f1fd66fa6f8e558744d0784226 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 23 Mar 2008 15:18:42 +0000 Subject: * 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 --- installer/OpenSLX/OSSetup/Engine.pm | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) (limited to 'installer/OpenSLX/OSSetup/Engine.pm') 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; -- cgit v1.2.3-55-g7522