appdwarf: seemingly fix images sometimes not unounting

This commit is contained in:
Phantop 2022-04-17 15:10:37 -04:00
parent 1caa827c68
commit e2f5be3a75
3 changed files with 2 additions and 9 deletions

View File

@ -43,10 +43,3 @@ created when ran since some programs care about that, such as an emulator only
running games of an expected file extension.
`zzexe` requires `zstd` for both creating and running files and `moreutils` for creating them.
## Known Issues
- Some images may not unmount properly under the default, combined mounting scheme due
to the inability to use lazy unmounting and some programs still making use of the filesystem
when `fusermount -u` is run.
- Can be worked around with the separate header at the cost of memory/CPU usage.

View File

@ -27,7 +27,7 @@ if [ ! -d "$DIR" ]; then
fi
"$DIR/AppRun" "$@"
fusermount -qu "$DIR"
fusermount -quz "$DIR"
rmdir "$DIR" 2> /dev/null
exit
EOF

2
zzexe
View File

@ -3,7 +3,7 @@ set -e # exit on failure
IFS=$(printf '\n\t') # smarter ifs
[ "$1" = "-d" ] && tail -n+10 "$2" | zstd -cd | ifne sponge "$2" && exit
[ "$1" = "-p" ] && p="$2" && shift 2 # save prefix if present
{ cat << 'EOF';zstdmt -c19 "$@";} |sed "2s/$/${1##*.})/;7s/^/$p /"| ifne sponge "$1"
{ cat << 'EOF'; zstdmt -c19 "$@"; } | sed "2s/$/${1##*.})/;7s/^/$p /" | sponge "$1"
#!/bin/sh
dir=$(dirname "$0") out=$(mktemp -t .zzXXXX.
tail -n+10 "$0" | zstd -cd > "$out"