summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--installer/OpenSLX/OSExport/FileSystem/NFS.pm39
-rw-r--r--installer/OpenSLX/OSExport/FileSystem/SquashFS.pm15
2 files changed, 52 insertions, 2 deletions
diff --git a/installer/OpenSLX/OSExport/FileSystem/NFS.pm b/installer/OpenSLX/OSExport/FileSystem/NFS.pm
index e034b127..86f7c128 100644
--- a/installer/OpenSLX/OSExport/FileSystem/NFS.pm
+++ b/installer/OpenSLX/OSExport/FileSystem/NFS.pm
@@ -61,7 +61,7 @@ sub exportVendorOS
}
$self->_copyViaRsync($source, $target);
-
+ $self->_copyUclibEnv($target);
return;
}
@@ -234,5 +234,42 @@ sub _isTargetBindMounted
return 0;
}
+sub _copyUclibEnv
+{
+ my $self = shift;
+ my $target = shift;
+
+ $target .= "/opt/openslx/uclib-rootfs";
+
+ if (system("mkdir -p $target")) {
+ die _tr("unable to create directory '%s', giving up! (%s)\n",
+ $target, $!);
+ }
+
+ my $uclibcRootfs = "$openslxConfig{'base-path'}/share/uclib-rootfs";
+ my @excludes = qw(
+ dialog
+ kexec
+ libcurses.so*
+ libncurses.so*
+ mconf
+ strace
+ );
+ my $exclOpts = join ' ', map { "--exclude $_" } @excludes;
+ my $includeExcludeList = $self->_determineIncludeExcludeList();
+ vlog(1, _tr("using exclude-filter:\n%s\n", $exclOpts));
+ my $rsyncFH;
+ my $rsyncCmd
+ = "rsync -av --delete-excluded --exclude-from=-" . " $uclibcRootfs/ $target";
+ vlog(2, "executing: $rsyncCmd\n");
+ open($rsyncFH, '|-', $rsyncCmd)
+ or die _tr("unable to start rsync for source '%s', giving up! (%s)",
+ $uclibcRootfs, $!);
+ print $rsyncFH $exclOpts;
+ close($rsyncFH)
+ or die _tr("unable to copy to target '%s', giving up! (%s)",
+ $target, $!);
+ return;
+}
1;
diff --git a/installer/OpenSLX/OSExport/FileSystem/SquashFS.pm b/installer/OpenSLX/OSExport/FileSystem/SquashFS.pm
index d9760642..fe70f8c2 100644
--- a/installer/OpenSLX/OSExport/FileSystem/SquashFS.pm
+++ b/installer/OpenSLX/OSExport/FileSystem/SquashFS.pm
@@ -207,11 +207,24 @@ sub _createSquashFS
my $filterFile = "/tmp/slx-nbdsquash-filter-$$";
spitFile($filterFile, $includeExcludeList);
+ # add uclib-root environment to stage2 by mounting it temporarily to stage1
+ # subdirectory of openslx stuff
+ my $uclibcRootfs = "$openslxConfig{'base-path'}/share/uclib-rootfs";
+ vlog(0, _tr("preparing stage1 to add uclib-rootfs..."));
+ my $res = system("mkdir -p $source/opt/openslx/uclib-rootfs");
+ $res = system("mount -o ro --bind $uclibcRootfs $source/opt/openslx/uclib-rootfs");
+ if ($res) {
+ die _tr(
+ "unable to prepare addition of uclib-rootfs in '%s', giving up! (%s)",
+ $source, $!);
+ }
+
# ... invoke mksquashfs ...
vlog(0, _tr("invoking mksquashfs..."));
my $mksquashfsBinary =
"$openslxConfig{'base-path'}/share/squashfs/mksquashfs";
- my $res = system("$mksquashfsBinary $source $target -ff $filterFile");
+ $res = system("$mksquashfsBinary $source $target -ff $filterFile");
+ $res = system("umount $source/opt/openslx/uclib-rootfs");
unlink($filterFile);
# ... remove filter file if done
if ($res) {