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>
17 lines
692 B
Bash
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 "$@"
|