diff options
| author | Simon Rettberg | 2014-02-19 14:43:25 +0100 |
|---|---|---|
| committer | Simon Rettberg | 2014-02-19 14:43:25 +0100 |
| commit | cc3045dfa8ea524b453a8029a15d16ec1ec7162b (patch) | |
| tree | 44bf2477073542fbdec2cb85f42dc58560995257 /server | |
| parent | [nvidia_kernel] conf: Added REQUIRED_DIRECTORIES /lib/modules/nvidia (diff) | |
| download | tm-scripts-cc3045dfa8ea524b453a8029a15d16ec1ec7162b.tar.gz tm-scripts-cc3045dfa8ea524b453a8029a15d16ec1ec7162b.tar.xz tm-scripts-cc3045dfa8ea524b453a8029a15d16ec1ec7162b.zip | |
[openslx] Check if mksquashfs supports xz, fall back to default compression if not
Diffstat (limited to 'server')
| -rw-r--r-- | server/includes/packing.inc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/server/includes/packing.inc b/server/includes/packing.inc index b94d06e8..d24c8e51 100644 --- a/server/includes/packing.inc +++ b/server/includes/packing.inc @@ -32,8 +32,17 @@ generate_squashfs() { if [ -n "$3" ]; then find "$3" -type f -o -type l | cut -c "$(( ${#3} + 2 ))-" > "$IGNORE" fi + # Detect mksquashfs xz support + local PARAMS + if mksquashfs 2>&1 | grep -A 8 '^-comp' | grep -q '\sxz'; then + pinfo "Using xz compression" + PARAMS="-comp xz" + else + pinfo "Using default compression" + PARAMS="" + fi rm -f -- "$2" - mksquashfs "$1" "$2" -ef "$IGNORE" -comp xz -b 1M -no-recovery >&6 \ + mksquashfs "$1" "$2" -ef "$IGNORE" $PARAMS -b 1M -no-recovery >&6 \ || perror "mksquashfs failed ($?)." pinfo "Created squashfs of $1 at $2" pinfo "Size: $(du -bsh "$2" | awk 'END {print $1}')" |
