aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsquashfu4
-rw-r--r--squashfu.conf10
2 files changed, 12 insertions, 2 deletions
diff --git a/squashfu b/squashfu
index b923fca..cc91e33 100755
--- a/squashfu
+++ b/squashfu
@@ -29,7 +29,7 @@ create_new_squash () {
# If making first seed, create it directly from source
if [[ $1 -eq -1 ]]; then
info "Creating seed from sources (this may take a while)"
- mksquashfs "${INCLUDES[@]}" "$SEED" -b 65536 -e "${EXCLUDES[@]}" >/dev/null
+ mksquashfs "${INCLUDES[@]}" "$SEED" -b 65536 -e "${EXCLUDES[@]}" -comp "$COMPRESSION_ALGO" ${COMPRESSION_ARGS[@]} > /dev/null
if [[ $? -eq 0 ]]; then
mount_squash
info "Seed creation finished. It has been mounted at "$SQUASH_MOUNT" if you would like to make sure the proper files are included"
@@ -47,7 +47,7 @@ create_new_squash () {
info "Merging old incrementals"
# Create new squash with temp name, exiting on failure
- mksquashfs "$UNION_MOUNT" "$SEED.replace" -b 65536 >/dev/null || return 1
+ mksquashfs "$UNION_MOUNT" "$SEED.replace" -b 65536 -comp "$COMPRESSION_ALGO" ${COMPRESSION_ARGS[@]} > /dev/null || return 1
unmount_all
diff --git a/squashfu.conf b/squashfu.conf
index 67012a9..f15b83d 100644
--- a/squashfu.conf
+++ b/squashfu.conf
@@ -55,6 +55,16 @@ DEL_BIN_ON_FAIL=(1)
# not be true incrementals. See 'man rsync' for more info.
RSYNC_OPTS=("-Rua" "--delete" "--stats")
+# Select compression algorithm.
+# Available options: gzip, lzo, lz4, xz, zstd, lzma
+# For details, see mksquashfs manpage.
+COMPRESSION_ALGO="zstd"
+
+# Add options for compression algorithm.
+# For zstd, only compression level is configurable.
+# For other compression algorithms, see mksquashfs manpage.
+COMPRESSION_ARGS=("-Xcompression-level" 15)
+
# The following defines what will and won't be backed up. These are
# simply Bash arrays and are interpreted as such.