mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
scripts/image: use maximum lzo and zstd compression level for images
For LZO, this saves about 40kb on img.gz size. For GZIP, this saves about 4kb on img.gz size. For ZSTD, this saves about 500kb on img.gz size. Signed-off-by: Ian Leonard <antonlacon@gmail.com>
This commit is contained in:
parent
61a08eac1e
commit
aecf28220e
@ -231,9 +231,16 @@ rm -rf $TARGET_IMG/$IMAGE_NAME.kernel
|
||||
cp -PR $BUILD/linux-$(kernel_version)/arch/$TARGET_KERNEL_ARCH/boot/$KERNEL_TARGET $TARGET_IMG/$IMAGE_NAME.kernel
|
||||
chmod 0644 $TARGET_IMG/$IMAGE_NAME.kernel
|
||||
|
||||
# use strongest available compression level for images
|
||||
if [ "$SQUASHFS_COMPRESSION" = "lzo" -o "${SQUASHFS_COMPRESSION:-gzip}" = "gzip" ]; then
|
||||
SQUASHFS_COMPRESSION_OPTION="-Xcompression-level 9"
|
||||
elif [ "$SQUASHFS_COMPRESSION" = "zstd" ]; then
|
||||
SQUASHFS_COMPRESSION_OPTION="-Xcompression-level 22"
|
||||
fi
|
||||
|
||||
# create squashfs file, default to gzip if no compression configured
|
||||
echo "rm -rf \"$TARGET_IMG/$IMAGE_NAME.system\"" >> $FAKEROOT_SCRIPT
|
||||
echo "$TOOLCHAIN/bin/mksquashfs \"$BUILD/image/system\" \"$TARGET_IMG/$IMAGE_NAME.system\" -noappend -comp ${SQUASHFS_COMPRESSION:-gzip}" >> $FAKEROOT_SCRIPT
|
||||
echo "$TOOLCHAIN/bin/mksquashfs \"$BUILD/image/system\" \"$TARGET_IMG/$IMAGE_NAME.system\" -noappend -comp ${SQUASHFS_COMPRESSION:-gzip} ${SQUASHFS_COMPRESSION_OPTION}" >> $FAKEROOT_SCRIPT
|
||||
|
||||
# run fakeroot
|
||||
$TOOLCHAIN/bin/fakeroot -- $FAKEROOT_SCRIPT
|
||||
|
Loading…
x
Reference in New Issue
Block a user