Skip to content

Commit

Permalink
Merge pull request #60 from flatcar/kai/mksquashfs-version
Browse files Browse the repository at this point in the history
bake.sh: Gate mksquashfs xattr exclusion behind version check
  • Loading branch information
pothos authored Apr 18, 2024
2 parents a1acc37 + d1419fc commit 313b804
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 313b804

Please sign in to comment.