mirror of
https://github.com/LSPosed/MagiskOnWSALocal.git
synced 2025-05-06 23:06:34 +08:00
Remove support for the compression format tar.xz
This format has a very large memory requirement for generation, about 16GB, even with a fallback to a single-threaded compression step, which would be very slow. This format is not widely used on Windows, and decompression is a pain. The 7z format has a better balance of size and performance requirements.
This commit is contained in:
parent
02621fc608
commit
3b39690fef
@ -8,10 +8,10 @@
|
|||||||
|
|
||||||
The following dependencies are required:
|
The following dependencies are required:
|
||||||
|
|
||||||
| DistrOS | | | | |
|
| DistrOS | | | |
|
||||||
|:-------------------:|---------------------------------------------------------------------------|------------|------------|--------------|
|
|:-------------------:|---------------------------------------------------------------------------|------------|--------------|
|
||||||
| Debian | `lzip patchelf e2fsprogs python3 python3-pip aria2 p7zip-full attr unzip` | `whiptail` | `xz-utils` | `qemu-utils` |
|
| Debian | `lzip patchelf e2fsprogs python3 python3-pip aria2 p7zip-full attr unzip` | `whiptail` | `qemu-utils` |
|
||||||
| openSUSE Tumbleweed | Same as above | `dialog` | `xz` | `qemu-tools` |
|
| openSUSE Tumbleweed | Same as above | `dialog` | `qemu-tools` |
|
||||||
|
|
||||||
The python3 library `requests` is used.
|
The python3 library `requests` is used.
|
||||||
|
|
||||||
|
@ -188,7 +188,6 @@ ROOT_SOL_MAP=(
|
|||||||
|
|
||||||
COMPRESS_FORMAT_MAP=(
|
COMPRESS_FORMAT_MAP=(
|
||||||
"7z"
|
"7z"
|
||||||
"xz"
|
|
||||||
"zip"
|
"zip"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -886,21 +885,12 @@ if [ "$COMPRESS_OUTPUT" ] || [ -n "$COMPRESS_FORMAT" ]; then
|
|||||||
fi
|
fi
|
||||||
if [ -n "$COMPRESS_FORMAT" ]; then
|
if [ -n "$COMPRESS_FORMAT" ]; then
|
||||||
FILE_EXT=".$COMPRESS_FORMAT"
|
FILE_EXT=".$COMPRESS_FORMAT"
|
||||||
if [ "$FILE_EXT" = ".xz" ]; then
|
|
||||||
FILE_EXT=".tar$FILE_EXT"
|
|
||||||
fi
|
|
||||||
OUTPUT_PATH="$OUTPUT_PATH$FILE_EXT"
|
OUTPUT_PATH="$OUTPUT_PATH$FILE_EXT"
|
||||||
fi
|
fi
|
||||||
rm -f "${OUTPUT_PATH:?}" || abort
|
rm -f "${OUTPUT_PATH:?}" || abort
|
||||||
if [ "$COMPRESS_FORMAT" = "7z" ]; then
|
if [ "$COMPRESS_FORMAT" = "7z" ]; then
|
||||||
echo "Compressing with 7z"
|
echo "Compressing with 7z"
|
||||||
7z a "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name" || abort
|
7z a "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name" || abort
|
||||||
elif [ "$COMPRESS_FORMAT" = "xz" ]; then
|
|
||||||
echo "Compressing with tar xz"
|
|
||||||
if ! (tar -cP -I 'xz -9 -T0' -f "$OUTPUT_PATH" "$WORK_DIR/wsa/$artifact_name"); then
|
|
||||||
echo "Out of memory? Trying again with single threads...."
|
|
||||||
tar -cPJvf "$OUTPUT_PATH" "$WORK_DIR/wsa/$artifact_name" || abort
|
|
||||||
fi
|
|
||||||
elif [ "$COMPRESS_FORMAT" = "zip" ]; then
|
elif [ "$COMPRESS_FORMAT" = "zip" ]; then
|
||||||
echo "Compressing with zip"
|
echo "Compressing with zip"
|
||||||
7z -tzip a "$OUTPUT_PATH" "$WORK_DIR/wsa/$artifact_name" || abort
|
7z -tzip a "$OUTPUT_PATH" "$WORK_DIR/wsa/$artifact_name" || abort
|
||||||
|
@ -46,7 +46,6 @@ check_dependencies() {
|
|||||||
command -v aria2c >/dev/null 2>&1 || NEED_INSTALL+=("aria2")
|
command -v aria2c >/dev/null 2>&1 || NEED_INSTALL+=("aria2")
|
||||||
command -v 7z >/dev/null 2>&1 || NEED_INSTALL+=("p7zip-full")
|
command -v 7z >/dev/null 2>&1 || NEED_INSTALL+=("p7zip-full")
|
||||||
command -v setfattr >/dev/null 2>&1 || NEED_INSTALL+=("attr")
|
command -v setfattr >/dev/null 2>&1 || NEED_INSTALL+=("attr")
|
||||||
command -v xz >/dev/null 2>&1 || NEED_INSTALL+=("xz-utils")
|
|
||||||
command -v unzip >/dev/null 2>&1 || NEED_INSTALL+=("unzip")
|
command -v unzip >/dev/null 2>&1 || NEED_INSTALL+=("unzip")
|
||||||
command -v qemu-img >/dev/null 2>&1 || NEED_INSTALL+=("qemu-utils")
|
command -v qemu-img >/dev/null 2>&1 || NEED_INSTALL+=("qemu-utils")
|
||||||
}
|
}
|
||||||
@ -112,7 +111,6 @@ if [ -n "${NEED_INSTALL[*]}" ]; then
|
|||||||
{
|
{
|
||||||
NEED_INSTALL_FIX=${NEED_INSTALL_FIX//setools/setools-console} 2>&1
|
NEED_INSTALL_FIX=${NEED_INSTALL_FIX//setools/setools-console} 2>&1
|
||||||
NEED_INSTALL_FIX=${NEED_INSTALL_FIX//whiptail/dialog} 2>&1
|
NEED_INSTALL_FIX=${NEED_INSTALL_FIX//whiptail/dialog} 2>&1
|
||||||
NEED_INSTALL_FIX=${NEED_INSTALL_FIX//xz-utils/xz} 2>&1
|
|
||||||
NEED_INSTALL_FIX=${NEED_INSTALL_FIX//qemu-utils/qemu-tools} 2>&1
|
NEED_INSTALL_FIX=${NEED_INSTALL_FIX//qemu-utils/qemu-tools} 2>&1
|
||||||
} >>/dev/null
|
} >>/dev/null
|
||||||
|
|
||||||
|
@ -133,9 +133,8 @@ if [ "$COMPRESS_OUTPUT" = "--compress" ]; then
|
|||||||
COMPRESS_FORMAT=$(
|
COMPRESS_FORMAT=$(
|
||||||
Radiolist '([title]="Compress format"
|
Radiolist '([title]="Compress format"
|
||||||
[default]="7z")' \
|
[default]="7z")' \
|
||||||
'zip' "Zip" 'off' \
|
|
||||||
'7z' "7-Zip" 'on' \
|
'7z' "7-Zip" 'on' \
|
||||||
'xz' "tar.xz" 'off'
|
'zip' "Zip" 'off'
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user