Fix the squashfs image extraction

This commit is contained in:
Kron4ek 2021-04-12 14:23:29 +05:00 committed by GitHub
parent 313958776c
commit a61db786ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,7 @@ export working_dir=/tmp/"$(basename "${script}")"_"${USER}"_"${script_md5}"
# a problem with mounting the squashfs image due to an incorrectly calculated offset. # a problem with mounting the squashfs image due to an incorrectly calculated offset.
# The size of this script # The size of this script
scriptsize=13764 scriptsize=13785
# The size of the utils.tar archive # The size of the utils.tar archive
# utils.tar contains bwrap and squashfuse binaries # utils.tar contains bwrap and squashfuse binaries
@ -45,8 +45,8 @@ if [ "$1" = "--help" ] || [ "$1" = "-h" ] || ([ -z "$1" ] && [ -z "${AUTOSTART}"
echo echo
echo "Arguments:" echo "Arguments:"
echo echo
echo -e "-e \tExtract squashfs image" echo -e "-e \tExtract the squashfs image"
echo -e "-o \tShow squashfs image offset" echo -e "-o \tShow the squashfs image offset"
echo echo
echo "Environment variables:" echo "Environment variables:"
echo echo
@ -95,7 +95,7 @@ if [ "$1" = "--help" ] || [ "$1" = "-h" ] || ([ -z "$1" ] && [ -z "${AUTOSTART}"
exit exit
elif [ "$1" = "-e" ]; then elif [ "$1" = "-e" ]; then
if command -v unsquashfs 1>/dev/null; then if command -v unsquashfs 1>/dev/null; then
unsquashfs -o $offset -d "$(basename "${script}")"_files "${script}" unsquashfs -o $offset -user-xattrs -d "$(basename "${script}")"_files "${script}"
else else
echo "To extract the image install squashfs-tools." echo "To extract the image install squashfs-tools."
fi fi