From d1419fc1254f9723a3614811bdd29f9d6a3bba9d Mon Sep 17 00:00:00 2001 From: Kai Lueke Date: Wed, 17 Apr 2024 22:13:31 +0900 Subject: [PATCH] bake.sh: Gate mksquashfs xattr exclusion behind version check Old mksquashfs versions don't support the xattr exclusion that was added to prevent harmless warnings getting printed. To support old mksquashfs versions, gate this behind a version check. --- bake.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bake.sh b/bake.sh index 8047c91..0513df3 100755 --- a/bake.sh +++ b/bake.sh @@ -63,6 +63,13 @@ elif [ "${FORMAT}" = "ext4" ] || [ "${FORMAT}" = "ext2" ]; then mkfs."${FORMAT}" -E root_owner=0:0 -d "${SYSEXTNAME}" "${SYSEXTNAME}".raw resize2fs -M "${SYSEXTNAME}".raw else - mksquashfs "${SYSEXTNAME}" "${SYSEXTNAME}".raw -all-root -noappend -xattrs-exclude '^btrfs.' + VER=$({ mksquashfs -version || true ; } | head -n1 | cut -d " " -f 3) + VERMAJ=$(echo "${VER}" | cut -d . -f 1) + VERMIN=$(echo "${VER}" | cut -d . -f 2) + ARG=(-all-root -noappend) + if [ "${VERMAJ}" -gt 4 ] && [ "${VERMIN}" -gt 6 ]; then + ARG+=('-xattrs-exclude' '^btrfs.') + fi + mksquashfs "${SYSEXTNAME}" "${SYSEXTNAME}".raw "${ARG[@]}" fi echo "Created ${SYSEXTNAME}.raw"