public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Felix Moessbauer <felix.moessbauer@siemens.com>
To: isar-users@googlegroups.com
Cc: henning.schild@siemens.com,
	Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH 1/1] add zchunk compression support
Date: Thu, 27 Apr 2023 05:51:18 +0000	[thread overview]
Message-ID: <20230427055118.1993072-1-felix.moessbauer@siemens.com> (raw)

This patch adds support to compress images with zchunk. The compression
format is optimized for delta transfers, by ensuring that small changes
on the input also only invalidate some blocks of the output.

There are not yet many configuration options available, but once
available, they can be added to the ZCK_DEFAULTS variable.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/classes/imagetypes.bbclass | 5 ++++-
 meta/conf/bitbake.conf          | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/meta/classes/imagetypes.bbclass b/meta/classes/imagetypes.bbclass
index a80a6da5..3639662b 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 zst"
+IMAGE_CONVERSIONS = "gz xz zst zck"
 
 CONVERSION_CMD:gz = "${SUDO_CHROOT} sh -c 'gzip -f -9 -n -c --rsyncable ${IMAGE_FILE_CHROOT} > ${IMAGE_FILE_CHROOT}.gz'"
 CONVERSION_DEPS:gz = "gzip"
@@ -103,3 +103,6 @@ CONVERSION_DEPS:xz = "xz-utils"
 
 CONVERSION_CMD:zst = "${SUDO_CHROOT} sh -c 'zstd -c --sparse ${ZSTD_DEFAULTS} ${IMAGE_FILE_CHROOT} > ${IMAGE_FILE_CHROOT}.zst'"
 CONVERSION_DEPS:zst = "zstd"
+
+CONVERSION_CMD:zck = "${SUDO_CHROOT} sh -c 'cd $(dirname ${IMAGE_FILE_CHROOT}); zck ${ZCK_DEFAULTS} ${IMAGE_FILE_CHROOT}'"
+CONVERSION_DEPS:zck = "zchunk"
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index c660660a..f73e4838 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -144,6 +144,9 @@ ZSTD_LEVEL ?= "19"
 ZSTD_DEFAULTS ?= "--rsyncable -${ZSTD_LEVEL} --threads=${ZSTD_THREADS}"
 ZSTD_DEFAULTS[vardepsexclude] += "ZSTD_LEVEL ZSTD_THREADS"
 
+# Default compression settings for zchunk
+ZCK_DEFAULTS ?= ""
+
 BBINCLUDELOGS ??= "yes"
 
 # Add event handlers for bitbake
-- 
2.34.1


             reply	other threads:[~2023-04-27  5:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27  5:51 Felix Moessbauer [this message]
2023-04-27  6:18 ` Schmidt, Adriaan
2023-04-27  6:37   ` Moessbauer, Felix
2023-05-24  4:05     ` Uladzimir Bely
2023-05-24  6:38       ` Schmidt, Adriaan
2023-05-24  7:49         ` MOESSBAUER, Felix
2023-05-24 12:10 ` Uladzimir Bely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230427055118.1993072-1-felix.moessbauer@siemens.com \
    --to=felix.moessbauer@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox