From 565a33d62d8b6d7c46302220b417aaa8f98ed7ba Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Wed, 17 Jan 2024 12:30:55 +0100 Subject: [PATCH] Add SWITCH to define XZ compression as a parameter and leave defaults as is --- lib/functions/image/compress-checksum.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/functions/image/compress-checksum.sh b/lib/functions/image/compress-checksum.sh index 0eed1393a5..f103d960be 100644 --- a/lib/functions/image/compress-checksum.sh +++ b/lib/functions/image/compress-checksum.sh @@ -35,10 +35,11 @@ function output_images_compress_and_checksum() { # get just the filename, sans path declare uncompressed_file_basename uncompressed_file_basename=$(basename "${uncompressed_file}") + declare xz_compression_ratio_image="${IMAGE_XZ_COMPRESSION_RATIO:-"1"}" if [[ $COMPRESS_OUTPUTIMAGE == *xz* ]]; then display_alert "Compressing with xz" "${uncompressed_file_basename}.xz" "info" - xz -T 0 -1 "${uncompressed_file}" # "If xz is provided with input but no output, it will delete the input" + xz -T 0 "-${xz_compression_ratio_image}" "${uncompressed_file}" # "If xz is provided with input but no output, it will delete the input" compression_type=".xz" fi