From 8096898aa0251301dc1943ca4375158919b340d9 Mon Sep 17 00:00:00 2001 From: Sebastian Schmelzer Date: Mon, 9 Mar 2009 15:35:27 +0000 Subject: * OSSetup install now uses the uclib environment * minor fix for suse install * added script for fetching suse mirrors git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2699 95ad53e4-c205-0410-b2fa-d234c58c8868 --- installer/OpenSLX/OSSetup/Engine.pm | 49 ++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 14 deletions(-) (limited to 'installer/OpenSLX/OSSetup/Engine.pm') diff --git a/installer/OpenSLX/OSSetup/Engine.pm b/installer/OpenSLX/OSSetup/Engine.pm index 14843f0b..821df9a0 100644 --- a/installer/OpenSLX/OSSetup/Engine.pm +++ b/installer/OpenSLX/OSSetup/Engine.pm @@ -51,9 +51,9 @@ use vars qw(%supportedDistros); 'suse-10.2_x86_64' => 'clone,install,update,shell', 'suse-10.3' => 'clone,update,shell', 'suse-10.3_x86_64' => 'clone,update,shell', - 'suse-11.0' => 'clone,update,shell', + 'suse-11.0' => 'clone,update,shell,install', 'suse-11.0_x86_64' => 'clone,update,shell', - 'suse-11.1' => 'clone,update,shell', + 'suse-11.1' => 'clone,update,shell,install', 'suse-11.1_x86_64' => 'clone,update,shell', 'scilin-4.7' => 'clone,update,shell', 'scilin-5.1' => 'clone,update,shell', @@ -1047,10 +1047,11 @@ sub _touchVendorOS sub _copyUclibcRootfs { my $self = shift; + my $targetRoot = shift || $self->{'vendor-os-path'}; vlog(0, _tr("copying uclibc-rootfs into vendor-OS ...\n")); - my $targetRoot = $self->{'vendor-os-path'}; + # my $targetRoot = $self->{'vendor-os-path'}; my $target = "$targetRoot/opt/openslx/uclib-rootfs"; if (system("mkdir -p $target")) { @@ -1073,6 +1074,8 @@ sub _copyUclibcRootfs my $rsyncCmd = "rsync -aq --delete-excluded --exclude-from=- $uclibcRootfs/ $target"; vlog(2, "executing: $rsyncCmd\n"); + # if we're doing a fresh install we need to create /lib first + system("mkdir -p $targetRoot/lib"); # link uClibc from the uclib-rootfs to /lib to make LD_PRELOAD=... working my $uClibCmd = "ln -sf /opt/openslx/uclib-rootfs/lib/ld-uClibc.so.0"; $uClibCmd .= " $targetRoot/lib/ld-uClibc.so.0"; @@ -1169,7 +1172,7 @@ try_next_url: foreach my $file (split '\s+', $fileVariantStr) { my $basefile = basename($file); vlog(2, "fetching <$file>..."); - if (slxsystem("wget", "-c", "-O", "$basefile", "$url/$file") == 0) { + if (system("wget", "-c", "-O", "$basefile", "$url/$file") == 0) { $foundFile = $basefile; last; } @@ -1262,13 +1265,29 @@ sub _setupStage1A $stage1cDir, $!); } - $self->_stage1A_createBusyboxEnvironment(); + #$self->_stage1A_createBusyboxEnvironment(); + $self->_stage1A_setupUclibcEnvironment(); $self->_stage1A_copyPrerequiredFiles(); $self->_stage1A_copyTrustedPackageKeys(); $self->_stage1A_createRequiredFiles(); return; } +sub _stage1A_setupUclibcEnvironment +{ + my $self = shift; + $self->_copyUclibcRootfs("$self->{stage1aDir}/$self->{stage1bSubdir}"); + my $source = "$self->{stage1bSubdir}/opt/openslx/uclib-rootfs"; + my $target = "$self->{stage1aDir}"; + system("ln -sf $source/bin $target/bin"); + system("ln -sf $source/lib $target/lib"); + system("ln -sf $source/usr $target/usr"); + $self->_stage1A_setupResolver(); + + return; +} + + sub _stage1A_createBusyboxEnvironment { my $self = shift; @@ -1321,9 +1340,9 @@ sub _stage1A_setupResolver copyFile('/etc/resolv.conf', "$self->{stage1aDir}/etc"); copyFile('/etc/nsswitch.conf', "$self->{stage1aDir}/etc"); spitFile("$self->{stage1aDir}/etc/hosts", "127.0.0.1 localhost\n"); - copyFile("$libcFolder/libresolv*", "$self->{stage1aDir}$libcFolder"); - copyFile("$libcFolder/libnss_dns*", "$self->{stage1aDir}$libcFolder"); - copyFile("$libcFolder/libnss_files*", "$self->{stage1aDir}$libcFolder"); + #copyFile("$libcFolder/libresolv*", "$self->{stage1aDir}$libcFolder"); + #copyFile("$libcFolder/libnss_dns*", "$self->{stage1aDir}$libcFolder"); + #copyFile("$libcFolder/libnss_files*", "$self->{stage1aDir}$libcFolder"); my $stage1cDir = "$self->{'stage1aDir'}/$self->{'stage1bSubdir'}/$self->{'stage1cSubdir'}"; @@ -1350,6 +1369,7 @@ sub _stage1A_copyPrerequiredFiles $stage1cDir, $! ); } + vlog(2, "fix pre-required files..."); $self->{distro}->fixPrerequiredFiles($stage1cDir); return; } @@ -1523,12 +1543,13 @@ sub _stage1C_cleanupBasicVendorOS $self->{'vendor-os-path'}, $! ); } - if (slxsystem("rm -rf $self->{stage1aDir}")) { - die _tr( - "unable to remove temporary folder '%s' (%s)\n", - $self->{stage1aDir}, $! - ); - } + die(); + #if (slxsystem("rm -rf $self->{stage1aDir}")) { + # die _tr( + # "unable to remove temporary folder '%s' (%s)\n", + # $self->{stage1aDir}, $! + # ); + #} return; } -- cgit v1.2.3-55-g7522