mirror of
https://github.com/LSPosed/MagiskOnWSALocal.git
synced 2025-05-06 14:56:36 +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:
|
||||
|
||||
| DistrOS | | | | |
|
||||
|:-------------------:|---------------------------------------------------------------------------|------------|------------|--------------|
|
||||
| Debian | `lzip patchelf e2fsprogs python3 python3-pip aria2 p7zip-full attr unzip` | `whiptail` | `xz-utils` | `qemu-utils` |
|
||||
| openSUSE Tumbleweed | Same as above | `dialog` | `xz` | `qemu-tools` |
|
||||
| DistrOS | | | |
|
||||
|:-------------------:|---------------------------------------------------------------------------|------------|--------------|
|
||||
| Debian | `lzip patchelf e2fsprogs python3 python3-pip aria2 p7zip-full attr unzip` | `whiptail` | `qemu-utils` |
|
||||
| openSUSE Tumbleweed | Same as above | `dialog` | `qemu-tools` |
|
||||
|
||||
The python3 library `requests` is used.
|
||||
|
||||
|
@ -188,7 +188,6 @@ ROOT_SOL_MAP=(
|
||||
|
||||
COMPRESS_FORMAT_MAP=(
|
||||
"7z"
|
||||
"xz"
|
||||
"zip"
|
||||
)
|
||||
|
||||
@ -886,21 +885,12 @@ if [ "$COMPRESS_OUTPUT" ] || [ -n "$COMPRESS_FORMAT" ]; then
|
||||
fi
|
||||
if [ -n "$COMPRESS_FORMAT" ]; then
|
||||
FILE_EXT=".$COMPRESS_FORMAT"
|
||||
if [ "$FILE_EXT" = ".xz" ]; then
|
||||
FILE_EXT=".tar$FILE_EXT"
|
||||
fi
|
||||
OUTPUT_PATH="$OUTPUT_PATH$FILE_EXT"
|
||||
fi
|
||||
rm -f "${OUTPUT_PATH:?}" || abort
|
||||
if [ "$COMPRESS_FORMAT" = "7z" ]; then
|
||||
echo "Compressing with 7z"
|
||||
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
|
||||
echo "Compressing with zip"
|
||||
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 7z >/dev/null 2>&1 || NEED_INSTALL+=("p7zip-full")
|
||||
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 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//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
|
||||
} >>/dev/null
|
||||
|
||||
|
@ -133,9 +133,8 @@ if [ "$COMPRESS_OUTPUT" = "--compress" ]; then
|
||||
COMPRESS_FORMAT=$(
|
||||
Radiolist '([title]="Compress format"
|
||||
[default]="7z")' \
|
||||
'zip' "Zip" 'off' \
|
||||
'7z' "7-Zip" 'on' \
|
||||
'xz' "tar.xz" 'off'
|
||||
'zip' "Zip" 'off'
|
||||
)
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user