summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe
diff options
context:
space:
mode:
authorBenjamin Szőke <egyszeregy@freemail.hu>2022-11-07 14:31:54 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-11-07 21:57:21 +0000
commitf2aff70b0ea4f2de6676615315a53bb160694b7d (patch)
tree18fbdf46e1715224f09064240db900175ccb04ba /meta/classes-recipe
parentbe91408e10805070f42f94e7f197aac9093b51b3 (diff)
downloadpoky-f2aff70b0ea4f2de6676615315a53bb160694b7d.tar.gz
image_types: Add 7-Zip support in conversion types and commands
Add 7-Zip support in conversion types and commands. Default arguments of 7-Zip are compression level: 9, method: BZip2, extension: 7z. All these are overridable from local.con for any other use case in user side. First goal was to make an alternative zip conversion which can operate faster in multi-thread systems (on many CPU cores), normal zip is just a single thread compression. 7-Zip can do a compression in multi-thread processing, so it is fine to use and speed up it and 7-Zip is supported also in many platform to use. (From OE-Core rev: 5931b2898b5fa964768c2abf9b5aa556859152b3) Signed-off-by: Benjamin Szőke <egyszeregy@freemail.hu> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe')
-rw-r--r--meta/classes-recipe/image_types.bbclass8
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/classes-recipe/image_types.bbclass b/meta/classes-recipe/image_types.bbclass
index 764e6a5574..ae00728a74 100644
--- a/meta/classes-recipe/image_types.bbclass
+++ b/meta/classes-recipe/image_types.bbclass
@@ -59,6 +59,10 @@ XZ_INTEGRITY_CHECK ?= "crc32"
59 59
60ZIP_COMPRESSION_LEVEL ?= "-9" 60ZIP_COMPRESSION_LEVEL ?= "-9"
61 61
627ZIP_COMPRESSION_LEVEL ?= "9"
637ZIP_COMPRESSION_METHOD ?= "BZip2"
647ZIP_EXTENSION ?= "7z"
65
62ZSTD_COMPRESSION_LEVEL ?= "-3" 66ZSTD_COMPRESSION_LEVEL ?= "-3"
63 67
64JFFS2_SUM_EXTRA_ARGS ?= "" 68JFFS2_SUM_EXTRA_ARGS ?= ""
@@ -304,7 +308,7 @@ IMAGE_TYPES:append:x86-64 = " hddimg iso"
304# CONVERSION_CMD/DEPENDS. 308# CONVERSION_CMD/DEPENDS.
305COMPRESSIONTYPES ?= "" 309COMPRESSIONTYPES ?= ""
306 310
307CONVERSIONTYPES = "gz bz2 lzma xz lz4 lzo zip zst sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap u-boot vmdk vhd vhdx vdi qcow2 base64 gzsync zsync ${COMPRESSIONTYPES}" 311CONVERSIONTYPES = "gz bz2 lzma xz lz4 lzo zip 7zip zst sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap u-boot vmdk vhd vhdx vdi qcow2 base64 gzsync zsync ${COMPRESSIONTYPES}"
308CONVERSION_CMD:lzma = "lzma -k -f -7 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" 312CONVERSION_CMD:lzma = "lzma -k -f -7 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
309CONVERSION_CMD:gz = "gzip -f -9 -n -c --rsyncable ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.gz" 313CONVERSION_CMD:gz = "gzip -f -9 -n -c --rsyncable ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.gz"
310CONVERSION_CMD:bz2 = "pbzip2 -f -k ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" 314CONVERSION_CMD:bz2 = "pbzip2 -f -k ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
@@ -312,6 +316,7 @@ CONVERSION_CMD:xz = "xz -f -k -c ${XZ_COMPRESSION_LEVEL} ${XZ_DEFAULTS} --check=
312CONVERSION_CMD:lz4 = "lz4 -9 -z -l ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.lz4" 316CONVERSION_CMD:lz4 = "lz4 -9 -z -l ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.lz4"
313CONVERSION_CMD:lzo = "lzop -9 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" 317CONVERSION_CMD:lzo = "lzop -9 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
314CONVERSION_CMD:zip = "zip ${ZIP_COMPRESSION_LEVEL} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.zip ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" 318CONVERSION_CMD:zip = "zip ${ZIP_COMPRESSION_LEVEL} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.zip ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
319CONVERSION_CMD:7zip = "7za a -mx=${7ZIP_COMPRESSION_LEVEL} -mm=${7ZIP_COMPRESSION_METHOD} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.${7ZIP_EXTENSION} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
315CONVERSION_CMD:zst = "zstd -f -k -T0 -c ${ZSTD_COMPRESSION_LEVEL} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.zst" 320CONVERSION_CMD:zst = "zstd -f -k -T0 -c ${ZSTD_COMPRESSION_LEVEL} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.zst"
316CONVERSION_CMD:sum = "sumtool -i ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} -o ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sum ${JFFS2_SUM_EXTRA_ARGS}" 321CONVERSION_CMD:sum = "sumtool -i ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} -o ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sum ${JFFS2_SUM_EXTRA_ARGS}"
317CONVERSION_CMD:md5sum = "md5sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.md5sum" 322CONVERSION_CMD:md5sum = "md5sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.md5sum"
@@ -337,6 +342,7 @@ CONVERSION_DEPENDS_xz = "xz-native"
337CONVERSION_DEPENDS_lz4 = "lz4-native" 342CONVERSION_DEPENDS_lz4 = "lz4-native"
338CONVERSION_DEPENDS_lzo = "lzop-native" 343CONVERSION_DEPENDS_lzo = "lzop-native"
339CONVERSION_DEPENDS_zip = "zip-native" 344CONVERSION_DEPENDS_zip = "zip-native"
345CONVERSION_DEPENDS_7zip = "p7zip-native"
340CONVERSION_DEPENDS_zst = "zstd-native" 346CONVERSION_DEPENDS_zst = "zstd-native"
341CONVERSION_DEPENDS_sum = "mtd-utils-native" 347CONVERSION_DEPENDS_sum = "mtd-utils-native"
342CONVERSION_DEPENDS_bmap = "bmap-tools-native" 348CONVERSION_DEPENDS_bmap = "bmap-tools-native"