summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile10
-rwxr-xr-xinitramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs_3_3 (renamed from initramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs3)bin93192 -> 93192 bytes
-rwxr-xr-xinitramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs_4 (renamed from initramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs)bin97460 -> 97460 bytes
-rw-r--r--installer/OpenSLX/OSExport/Distro/Base.pm8
-rw-r--r--installer/OpenSLX/OSExport/Distro/Suse.pm19
-rw-r--r--installer/OpenSLX/OSExport/Distro/Ubuntu.pm20
-rw-r--r--installer/OpenSLX/OSExport/FileSystem/SquashFS.pm119
7 files changed, 163 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 8e92eadd..06f89665 100644
--- a/Makefile
+++ b/Makefile
@@ -196,11 +196,11 @@ plain-install:
tar -xp -C $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/; \
cp -p boot-env/syslinux/pxemenu-*.example boot-env/syslinux/README.pxe \
$(SLX_BUILD_PATH)$(SLX_CONFIG_PATH)/boot-env/syslinux/; \
- cp -p tools/mksquashfs $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/squashfs/; \
- cp -p initramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs3 \
- $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/squashfs/mksquashfs3; \
- cp -p initramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs \
- $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/squashfs/mksquashfs4; \
+ cp -p tools/mksquashfs $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/squashfs/mksquashfs_3_2; \
+ cp -p initramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs_3_3 \
+ $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/squashfs/; \
+ cp -p initramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs_4 \
+ $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/squashfs/; \
tar --exclude=.svn -cp -C initramfs tpm | \
tar -xp -C $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share; \
diff --git a/initramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs3 b/initramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs_3_3
index 0f4efdc8..0f4efdc8 100755
--- a/initramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs3
+++ b/initramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs_3_3
Binary files differ
diff --git a/initramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs b/initramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs_4
index b40e6e42..b40e6e42 100755
--- a/initramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs
+++ b/initramfs/eglibc-packages/mksquashfs/usr/bin/mksquashfs_4
Binary files differ
diff --git a/installer/OpenSLX/OSExport/Distro/Base.pm b/installer/OpenSLX/OSExport/Distro/Base.pm
index aa24f8de..5223ce95 100644
--- a/installer/OpenSLX/OSExport/Distro/Base.pm
+++ b/installer/OpenSLX/OSExport/Distro/Base.pm
@@ -47,6 +47,14 @@ sub initDistroInfo
{
}
+sub getSquashfsVersion
+{
+ my $self = shift;
+ my $distroVersion = shift;
+
+ return "4.0";
+}
+
1;
################################################################################
diff --git a/installer/OpenSLX/OSExport/Distro/Suse.pm b/installer/OpenSLX/OSExport/Distro/Suse.pm
index 586cf51a..9e62e6e5 100644
--- a/installer/OpenSLX/OSExport/Distro/Suse.pm
+++ b/installer/OpenSLX/OSExport/Distro/Suse.pm
@@ -123,4 +123,23 @@ sub initDistroInfo
return;
}
+
+sub getSquashfsVersion
+{
+ my $self = shift;
+ my $distroVersion = shift;
+
+ my %versionMap = (
+ '11.0' => '3.2',
+ '11.1' => '3.2',
+ '11.2' => '3.3',
+ '11.3' => '4.0'
+ );
+
+ my $distroDefault = '4.0';
+
+ return $versionMap{$distroVersion} || $distroDefault;
+}
+
+
1;
diff --git a/installer/OpenSLX/OSExport/Distro/Ubuntu.pm b/installer/OpenSLX/OSExport/Distro/Ubuntu.pm
index a1e477d5..3826f019 100644
--- a/installer/OpenSLX/OSExport/Distro/Ubuntu.pm
+++ b/installer/OpenSLX/OSExport/Distro/Ubuntu.pm
@@ -85,4 +85,24 @@ sub initDistroInfo
return;
}
+
+sub getSquashfsVersion
+{
+ my $self = shift;
+ my $distroVersion = shift;
+
+ my %versionMap = (
+ '8.04' => '3.3',
+ '8.10' => '3.3',
+ '9.04' => '3.3',
+ '9.10' => '4.0',
+ '10.04' => '4.0'
+ );
+
+ my $distroDefault = '4.0';
+
+ return $versionMap{$distroVersion} || $distroDefault;
+}
+
+
1;
diff --git a/installer/OpenSLX/OSExport/FileSystem/SquashFS.pm b/installer/OpenSLX/OSExport/FileSystem/SquashFS.pm
index a092ddf0..77034c9c 100644
--- a/installer/OpenSLX/OSExport/FileSystem/SquashFS.pm
+++ b/installer/OpenSLX/OSExport/FileSystem/SquashFS.pm
@@ -184,6 +184,10 @@ sub showExportConfigInfo
### implementation methods
################################################################################
+#################################################################################
+# Branch to choose the appropriate squashfs version according to target system #
+################################################################################
+
sub _createSquashFS
{
my $self = shift;
@@ -191,6 +195,34 @@ sub _createSquashFS
my $target = shift;
my $includeExcludeList = shift;
+
+ my @versionString = split(/-/, $self->{engine}->{'vendor-os-name'});
+ my $mksquashfsVersion = $self->{engine}->{distro}->getSquashfsVersion($versionString[1]);
+
+ vlog(0, "found version string $versionString[1] out of $self->{engine}->{'vendor-os-name'}");
+ vlog(0, "use squashfs version: $mksquashfsVersion");
+
+ $self->_createSquashFS_prepare($target);
+
+ my $mksquashfsParams;
+
+ $mksquashfsVersion == '3.2' && do
+ {$mksquashfsParams = $self->_createSquashFS_setup_3_2($includeExcludeList)};
+ $mksquashfsVersion == '3.3' && do
+ {$mksquashfsParams = $self->_createSquashFS_setup_3_3($includeExcludeList)};
+ $mksquashfsVersion == '4.0' && do
+ {$mksquashfsParams = $self->_createSquashFS_setup_4($includeExcludeList)};
+
+ $self->_createSquashFS_run($source, $target, $mksquashfsParams);
+
+ return;
+}
+
+sub _createSquashFS_prepare
+{
+ my $self = shift;
+ my $target = shift;
+
system("rm -f $target");
# mksquasfs isn't significantly faster if fs already exists, but it
# causes the filesystem to grow somewhat, so we remove it in order to
@@ -199,27 +231,98 @@ sub _createSquashFS
my $baseDir = dirname($target);
if (!-e $baseDir) {
if (system("mkdir -p $baseDir")) {
- die _tr("unable to create directory '%s', giving up! (%s)\n",
+ die _tr("unable to create directory '%s', giving up! (%s)\n",
$baseDir, $!);
}
}
+ return;
+}
- # dump filter to a file ...
- my $filterFile = "/tmp/slx-nbdsquash-filter-$$";
- spitFile($filterFile, $includeExcludeList);
+sub _createSquashFS_run {
+ my $self = shift;
+ my $source = shift;
+ my $target = shift;
+ my $params = shift;
+
# ... invoke mksquashfs ...
vlog(0, _tr("invoking mksquashfs..."));
- my $mksquashfsBinary =
- "$openslxConfig{'base-path'}/share/squashfs/mksquashfs";
- my $res = system("$mksquashfsBinary $source $target -ff $filterFile");
- unlink($filterFile);
+ my $mksquashfsBinary =
+ "$openslxConfig{'base-path'}/share/squashfs/$params->{binary}";
+ my $res =
+ system("$mksquashfsBinary $source $target $params->{cmdlineOptions}");
+ unlink($params->{tmpfile});
# ... remove filter file if done
if ($res) {
die _tr(
"unable to create squashfs for source '%s' as target '%s', giving up! (%s)",
$source, $target, $!);
}
+ return;
+}
+
+sub _createSquashFS_setup_4
+{
+ my $self = shift;
+ my $includeExcludeList = shift;
+
+ # dump filter to a file ...
+ my $filterFile = "/tmp/slx-nbdsquash-filter-$$";
+ my $includeFile = "/tmp/slx-nbdsquash-includes-$$";
+ spitFile($filterFile, $includeExcludeList);
+
+ slxsystem("sed $filterFile -e '/^-/d' -e 's/^+[ \t]*//' > $includeFile");
+ slxsystem("sed -i $filterFile -e '/^+/d' -e 's/^-[ \t]*//'");
+
+ my $result = {
+ binary => "mksquashfs_4",
+ cmdlineOptions => "-wildcards -ef $filterFile",
+ tmpfile => "$filterFile"
+ };
+
+ return $result;
+}
+
+
+sub _createSquashFS_setup_3_3
+{
+ my $self = shift;
+ my $includeExcludeList = shift;
+
+ # dump filter to a file ...
+ my $filterFile = "/tmp/slx-nbdsquash-filter-$$";
+ my $includeFile = "/tmp/slx-nbdsquash-includes-$$";
+ spitFile($filterFile, $includeExcludeList);
+
+ slxsystem("sed $filterFile -e '/^-/d' -e 's/^+[ \t]*//' > $includeFile");
+ slxsystem("sed -i $filterFile -e '/^+/d' -e 's/^-[ \t]*//'");
+
+ my $result = {
+ binary => "mksquashfs_3_3",
+ cmdlineOptions => "-wildcards -ef $filterFile",
+ tmpfile => "$filterFile"
+ };
+
+ return $result;
+}
+
+
+sub _createSquashFS_setup_3_2
+{
+ my $self = shift;
+ my $includeExcludeList = shift;
+
+ # dump filter to a file ...
+ my $filterFile = "/tmp/slx-nbdsquash-filter-$$";
+ spitFile($filterFile, $includeExcludeList);
+
+ my $result = {
+ binary => "mksquashfs_3_2",
+ cmdlineOptions => "-ff $filterFile",
+ tmpfile => "$filterFile"
+ };
+
+ return $result;
}
sub _determineIncludeExcludeList