public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] feat: add zstd support to image conversions
@ 2023-01-23 14:00 Michael Adler
  2023-01-23 19:22 ` Jan Kiszka
  2023-02-09 11:35 ` Uladzimir Bely
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Adler @ 2023-01-23 14:00 UTC (permalink / raw)
  To: isar-users; +Cc: Michael Adler

This patch enables ISAR to build zstd compressed images.

Signed-off-by: Michael Adler <michael.adler@siemens.com>
---
 meta/classes/imagetypes.bbclass | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/meta/classes/imagetypes.bbclass b/meta/classes/imagetypes.bbclass
index 1e8e223d..6950da7a 100644
--- a/meta/classes/imagetypes.bbclass
+++ b/meta/classes/imagetypes.bbclass
@@ -93,7 +93,7 @@ IMAGE_CMD_ubi() {
 IMAGE_CMD_ubi[depends] = "${PN}:do_transform_template"
 
 # image conversions
-IMAGE_CONVERSIONS = "gz xz"
+IMAGE_CONVERSIONS = "gz xz zst"
 
 CONVERSION_CMD_gz = "${SUDO_CHROOT} sh -c 'gzip -f -9 -n -c --rsyncable ${IMAGE_FILE_CHROOT} > ${IMAGE_FILE_CHROOT}.gz'"
 CONVERSION_DEPS_gz = "gzip"
@@ -105,3 +105,11 @@ XZ_OPTIONS ?= "--memlimit=${XZ_MEMLIMIT} --threads=${XZ_THREADS}"
 XZ_OPTIONS[vardepsexclude] += "XZ_MEMLIMIT XZ_THREADS"
 CONVERSION_CMD_xz = "${SUDO_CHROOT} sh -c 'xz -c ${XZ_OPTIONS} ${IMAGE_FILE_CHROOT} > ${IMAGE_FILE_CHROOT}.xz'"
 CONVERSION_DEPS_xz = "xz-utils"
+
+ZST_LEVEL ?= "19"
+ZST_THREADS ?= "${@oe.utils.cpu_count(at_least=2)}"
+ZST_THREADS[vardepvalue] = "1"
+ZST_OPTIONS ?= "-${ZST_LEVEL} --threads=${ZST_THREADS}"
+ZST_OPTIONS[vardepsexclude] += "ZST_LEVEL ZST_THREADS"
+CONVERSION_CMD_zst = "${SUDO_CHROOT} sh -c 'zstd -c ${ZST_OPTIONS} ${IMAGE_FILE_CHROOT} > ${IMAGE_FILE_CHROOT}.zst'"
+CONVERSION_DEPS_zst = "zstd"
-- 
2.39.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-09 11:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-23 14:00 [PATCH] feat: add zstd support to image conversions Michael Adler
2023-01-23 19:22 ` Jan Kiszka
2023-01-24  3:17   ` Roberto A. Foglietta
2023-01-24 12:05     ` Roberto A. Foglietta
2023-02-09 11:35 ` Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox