Only use lz4 compression in kernels 4.0 or newer

This commit is contained in:
Ramon Buldó 2015-10-04 01:57:33 +02:00
parent 32a98837c6
commit 16f8d87dcd

View file

@ -139,7 +139,8 @@ squash_image_dir() {
local highcomp="-b 256K -Xbcj x86"
[[ "${iso_compression}" != "xz" ]] && highcomp=""
msg2 "Creating SquashFS image. This may take some time..."
if [[ "$(basename "$1")" == "mhwd-image" ]]; then
local used_kernel=$(echo ${kernel} | cut -c 6)
if [[ "$(basename "$1")" == "mhwd-image" && ${used_kernel} -ge "4"]]; then
mksquashfs "${1}" "${sq_img}" -noappend -comp lz4 || die "Exit ..."
else
mksquashfs "${1}" "${sq_img}" -noappend -comp ${iso_compression} ${highcomp} || die "Exit ..."