Files
LinusandClaude Opus 5.5 c198c36ea4 Add unsquashfs and stop SquashFS tools failing on xattrs
Install Ubuntu's squashfs-tools so the stock unsquashfs/mksquashfs exist
next to sasquatch. As the non-root container user, unsquashfs and
sasquatch can't restore security.* xattrs and exit 2 although every file
was extracted; wrap them to pass -no-xattrs unless an xattr option is
given.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 19:51:45 +01:00

17 lines
692 B
Bash

#!/bin/sh
# Installed in the image as /usr/local/bin/{unsquashfs,sasquatch,sasquatch-v4be}
# (symlinks to this script), in front of the real tools in /usr/bin.
#
# As the unprivileged container user these tools can't restore security.*
# xattrs (SELinux labels, file capabilities) that firmware images often
# carry: they extract every file but print "not superuser" errors and exit 2,
# which reads as a failed extraction. Pass -no-xattrs unless the caller
# already chose an xattr option (-xattrs, -user-xattrs, -xattrs-include, ...).
tool="/usr/bin/$(basename "$0")"
for arg in "$@"; do
case "$arg" in
-*xattrs*) exec "$tool" "$@" ;;
esac
done
exec "$tool" -no-xattrs "$@"