fix(appimage): DwarFS AppImages unpack without proot (#3161)

This commit is contained in:
The412Banner authored and GitHub committed 2026-11-24 17:50:04 -05:00
1 parent f934feb457
commit 43ff1db06b
12 files changed
+208 -1

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
wrapper=${1:?usage: unwrap-dwarfs.sh WRAPPER OUTPUT}
output=${2:?usage: unwrap-dwarfs.sh WRAPPER OUTPUT}
[ "$(tail -c 32 "$wrapper" | head -c 8)" = "SQUEEZE!" ] || { echo "unwrap-dwarfs.sh: $wrapper has no SQUEEZE! trailer" >&2; exit 1; }
packed=$(tail -c 16 "$wrapper" | od -An -tu8 -N8 | tr -d ' ')
[ "$packed" -gt 0 ] && [ "$packed" -le $(( $(wc -c < "$wrapper") - 32 )) ] || { echo "unwrap-dwarfs.sh: bad payload size in $wrapper" >&2; exit 1; }
tail -c $((packed + 32)) "$wrapper" | head -c "$packed" | zstd -dcq > "$output"