diff --git a/bin/buildiso.in b/bin/buildiso.in index d21d70f..2ae176b 100755 --- a/bin/buildiso.in +++ b/bin/buildiso.in @@ -123,7 +123,7 @@ usage() { echo ' -m Set SquashFS image mode to persistence' echo ' -c Disable clean work dir' echo ' -f Build full ISO (extra=true)' - echo ' -d Compression used for build ISO: xz, gzip, lzma, lzo, lz4, zstd' + echo ' -d Compression used for build ISO: gzip, lzma, lz4, lzo, xz, zstd' echo " [default: ${iso_compression}]" echo ' -x Build images only' echo ' -z Generate iso only' diff --git a/data/manjaro-tools.conf b/data/manjaro-tools.conf index a5f6bd4..1dab98d 100644 --- a/data/manjaro-tools.conf +++ b/data/manjaro-tools.conf @@ -55,7 +55,7 @@ # the branding; default: auto # dist_branding="MJRO" -# compression used, possible values gzip, lzma, lzo, lz4, zstd (default) +# compression used, possible values gzip, lzma, lz4, lzo, xy, zstd (default) # iso_compression=zstd # unset defaults to given value diff --git a/lib/util-iso.sh b/lib/util-iso.sh index 2f54bc1..7f6287f 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -469,12 +469,12 @@ check_requirements(){ if ! $(is_valid_branch ${target_branch}); then die "%s is not a valid branch!" "${target_branch}" fi - - local iso_kernel=${kernel:5:1} host_kernel=$(uname -r) - if [[ ${iso_kernel} < "4" ]] \ - || [[ ${host_kernel%%*.} < "4" ]]; then - die "The host and iso kernels must be version>=4.0!" + if ! $(is_valid_comp ${iso_compression}); then + die "%s is not a valid compression algorithm!" "${iso_compression}" fi + + local iso_kernel=${kernel:5:1} + [[ ${iso_kernel} < "4" ]] && die "ISO kernel must be version>=4.0!" } compress_images(){ diff --git a/lib/util.sh b/lib/util.sh index 87f0f94..229f35c 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -768,6 +768,13 @@ is_valid_branch(){ esac } +is_valid_comp(){ + case $1 in + 'gzip'|'lzma'|'lz4'|'lzo'|'xz'|'zstd') return 0 ;; + *) return 1 ;; + esac +} + run(){ if ${is_build_list}; then for item in ${build_list[@]}; do