* [isar-cip-core][PATCH v1 0/5] Add support for delta kernel binary update
@ 2025-08-13 13:46 Shivanand Kunijadar
2025-08-13 13:46 ` [isar-cip-core][PATCH v1 1/5] delta-update.yml: Add previous image kernel file for rdiff delta update Shivanand Kunijadar
` (5 more replies)
0 siblings, 6 replies; 10+ messages in thread
From: Shivanand Kunijadar @ 2025-08-13 13:46 UTC (permalink / raw)
To: cip-dev, jan.kiszka; +Cc: shivanand.kunijadar, dinesh.kumar, kazuhiro3.hayashi
This patch series enables the delta kernel binary updates along with
rootfs. When rdiff is selected it generates deltas for both kernel and rootfs.
In the CI, we just change PV value to 2.0 for the second image and there
is no change (code) in the kernel binary at the moment. Do you think building
the second image with RT kernel is appropriate here to verify delta
kernel updates?
Shivanand Kunijadar (5):
delta-update.yml: Add previous image kernel file for rdiff delta
update
Add delta update support for kernel binary update using rdiff_file
handler
README.swupdate.md: Modify readme for kernel binary delta update
support.
swupdate-handler-roundrobin: Update revision for rdiff_file handler
support
.gitlab-ci.yml: Add linux.efi to previous image folder
.gitlab-ci.yml | 1 +
classes/delta-update.bbclass | 33 ++++++++++++++-----
classes/swupdate.bbclass | 24 ++++++++++----
doc/README.swupdate.md | 9 +++--
kas/opt/delta-update.yml | 1 +
recipes-core/images/swu/sw-description.tmpl | 7 ++--
.../swupdate-handler-roundrobin_0.1.bb | 2 +-
7 files changed, 55 insertions(+), 22 deletions(-)
--
2.39.5
^ permalink raw reply [flat|nested] 10+ messages in thread
* [isar-cip-core][PATCH v1 1/5] delta-update.yml: Add previous image kernel file for rdiff delta update
2025-08-13 13:46 [isar-cip-core][PATCH v1 0/5] Add support for delta kernel binary update Shivanand Kunijadar
@ 2025-08-13 13:46 ` Shivanand Kunijadar
2025-08-13 13:46 ` [isar-cip-core][PATCH v1 2/5] Add delta update support for kernel binary update using rdiff_file handler Shivanand Kunijadar
` (4 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Shivanand Kunijadar @ 2025-08-13 13:46 UTC (permalink / raw)
To: cip-dev, jan.kiszka; +Cc: shivanand.kunijadar, dinesh.kumar, kazuhiro3.hayashi
Signed-off-by: Shivanand Kunijadar <Shivanand.Kunijadar@toshiba-tsip.com>
---
kas/opt/delta-update.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/kas/opt/delta-update.yml b/kas/opt/delta-update.yml
index a2f583c..7d4c28c 100644
--- a/kas/opt/delta-update.yml
+++ b/kas/opt/delta-update.yml
@@ -17,4 +17,5 @@ local_conf_header:
IMAGE_FSTYPES:append = " delta_update"
DELTA_UPDATE_TYPE = "rdiff"
DELTA_RDIFF_REF_IMAGE = "${IMAGE_FULLNAME}.${SWU_ROOTFS_TYPE}"
+ DELTA_RDIFF_REF_KERNEL_IMAGE = "linux.efi"
DELTA_ZCK_URL = ""
--
2.39.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [isar-cip-core][PATCH v1 2/5] Add delta update support for kernel binary update using rdiff_file handler
2025-08-13 13:46 [isar-cip-core][PATCH v1 0/5] Add support for delta kernel binary update Shivanand Kunijadar
2025-08-13 13:46 ` [isar-cip-core][PATCH v1 1/5] delta-update.yml: Add previous image kernel file for rdiff delta update Shivanand Kunijadar
@ 2025-08-13 13:46 ` Shivanand Kunijadar
2025-08-14 10:08 ` Jan Kiszka
2025-08-13 13:46 ` [isar-cip-core][PATCH v1 3/5] README.swupdate.md: Modify readme for kernel binary delta update support Shivanand Kunijadar
` (3 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: Shivanand Kunijadar @ 2025-08-13 13:46 UTC (permalink / raw)
To: cip-dev, jan.kiszka; +Cc: shivanand.kunijadar, dinesh.kumar, kazuhiro3.hayashi
Signed-off-by: Shivanand Kunijadar <Shivanand.Kunijadar@toshiba-tsip.com>
---
classes/delta-update.bbclass | 33 +++++++++++++++------
classes/swupdate.bbclass | 24 +++++++++++----
recipes-core/images/swu/sw-description.tmpl | 7 +++--
3 files changed, 46 insertions(+), 18 deletions(-)
diff --git a/classes/delta-update.bbclass b/classes/delta-update.bbclass
index ab11be5..d033df0 100644
--- a/classes/delta-update.bbclass
+++ b/classes/delta-update.bbclass
@@ -15,6 +15,7 @@ FILESEXTRAPATHS:prepend = "${TOPDIR}/previous-image:"
DELTA_UPDATE_TYPE ??= ""
DELTA_RDIFF_REF_IMAGE ??= ""
+DELTA_RDIFF_REF_KERNEL_IMAGE ??= ""
DELTA_ZCK_URL ??= ""
DELTA_PREV_IMAGE_PATH ??= "${TOPDIR}/previous-image"
@@ -24,8 +25,8 @@ def disable_delta_update_tasks (d):
python () {
if d.getVar("DELTA_UPDATE_TYPE") == "rdiff":
- if d.getVar("DELTA_RDIFF_REF_IMAGE") == "":
- bb.fatal("You must set DELTA_RDIFF_REF_IMAGE and provide the required files as artifacts to this recipe")
+ if d.getVar("DELTA_RDIFF_REF_IMAGE") == "" or d.getVar("DELTA_RDIFF_REF_KERNEL_IMAGE") == "":
+ bb.fatal("You must set DELTA_RDIFF_REF_IMAGE and DELTA_RDIFF_REF_KERNEL_IMAGE and also provide the required files as artifacts to this recipe")
elif d.getVar("DELTA_UPDATE_TYPE") == "zchunk":
if d.getVar("BASE_DISTRO_CODENAME") != "trixie":
bb.fatal("Zchunk based delta update is only supported from trixie onward")
@@ -35,11 +36,13 @@ python () {
python do_fetch_delta_rdiff_ref_image () {
if d.getVar("DELTA_UPDATE_TYPE") == "rdiff":
- path = d.getVar("DELTA_PREV_IMAGE_PATH") + "/" + d.getVar("DELTA_RDIFF_REF_IMAGE")
- if not os.path.isfile(path):
- bb.fatal("No such file found: "+ path + ". Provide the required files at "+ d.getVar("DELTA_PREV_IMAGE_PATH") + " for rdiff based delta update")
+ rootfs_path = d.getVar("DELTA_PREV_IMAGE_PATH") + "/" + d.getVar("DELTA_RDIFF_REF_IMAGE")
+ kernel_path = d.getVar("DELTA_PREV_IMAGE_PATH") + "/" + d.getVar("DELTA_RDIFF_REF_KERNEL_IMAGE")
+ if not os.path.isfile(rootfs_path) or not os.path.isfile(kernel_path):
+ bb.fatal("No such files found: "+ rootfs_path + "," + kernel_path + ". Provide the required files at "+ d.getVar("DELTA_PREV_IMAGE_PATH") + " for rdiff based delta update")
else:
d.appendVar("SRC_URI", " file://" + d.getVar("DELTA_RDIFF_REF_IMAGE"))
+ d.appendVar("SRC_URI", " file://" + d.getVar("DELTA_RDIFF_REF_KERNEL_IMAGE"))
}
do_fetch[prefuncs] += "do_fetch_delta_rdiff_ref_image"
@@ -47,18 +50,30 @@ do_unpack[prefuncs] += "do_fetch_delta_rdiff_ref_image"
create_rdiff_delta_artifact() {
rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.delta
- # create signature file with rdiff
+ # create signature file with rdiff for rootfs
${SUDO_CHROOT} /usr/bin/rdiff signature ${WORKDIR}/${DELTA_RDIFF_REF_IMAGE} \
${WORKDIR}/delta_interim_artifacts/old-image-rootfs.sig
- # create delta file with the signature file
+ # create delta file with the signature file for rootfs
${SUDO_CHROOT} /usr/bin/rdiff delta ${WORKDIR}/delta_interim_artifacts/old-image-rootfs.sig \
${PP_DEPLOY}/${IMAGE_FULLNAME}.${SWU_ROOTFS_TYPE} ${PP_DEPLOY}/${IMAGE_FULLNAME}.delta
- DELTA_ARTIFACT_SWU=${IMAGE_FULLNAME}.delta
+ DELTA_ARTIFACT_ROOTFS_SWU=${IMAGE_FULLNAME}.delta
# create a symbolic link as IMAGE_CMD expects a *.delta_update file in deploy image directory
- ln -sf ${DELTA_ARTIFACT_SWU} ${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.delta_update
+ ln -sf ${DELTA_ARTIFACT_ROOTFS_SWU} ${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.delta_update
+
+ rm -f ${DEPLOY_DIR_IMAGE}/linux.efi.delta
+
+ # create signature file with rdiff for kernel
+ ${SUDO_CHROOT} /usr/bin/rdiff signature ${WORKDIR}/${DELTA_RDIFF_REF_KERNEL_IMAGE} \
+ ${WORKDIR}/delta_interim_artifacts/old-linux.efi.sig
+
+ # create delta file with the signature file for kernel
+ ${SUDO_CHROOT} /usr/bin/rdiff delta ${WORKDIR}/delta_interim_artifacts/old-linux.efi.sig \
+ ${PP_DEPLOY}/linux.efi ${PP_DEPLOY}/linux.efi.delta
+
+ ln -sf linux.efi.delta ${DEPLOY_DIR_IMAGE}/linux.efi.delta_update
}
create_zchunk_delta_artifact() {
diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass
index b0b05d5..c18aaa9 100644
--- a/classes/swupdate.bbclass
+++ b/classes/swupdate.bbclass
@@ -15,6 +15,7 @@ inherit template
RO_ROOTFS_TYPE ??= "squashfs"
SWU_ROOTFS_TYPE ?= "${RO_ROOTFS_TYPE}"
SWU_ROOTFS_NAME ?= "${IMAGE_FULLNAME}"
+SWU_KERNEL_NAME ?= "linux.efi"
# compression type as defined by swupdate (zlib or zstd). Set to empty string to disable compression
SWU_COMPRESSION_TYPE ?= "zlib"
SWU_ROOTFS_PARTITION_NAME ?= "${SWU_ROOTFS_NAME}.${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
@@ -32,9 +33,14 @@ SWU_ROOTFS_ARTIFACT_NAME = "${@ '${SWU_DELTA_UPDATE_ARTIFACT}' \
if d.getVar('DELTA_UPDATE_TYPE') == "rdiff" or d.getVar('DELTA_UPDATE_TYPE') == "zchunk" \
else '${SWU_ROOTFS_PARTITION_NAME}'}"
+SWU_DELTA_UPDATE_KERNEL_ARTIFACT = "${SWU_KERNEL_NAME}.delta_update"
+SWU_KERNEL_ARTIFACT_NAME = "${@ '${SWU_DELTA_UPDATE_KERNEL_ARTIFACT}' \
+ if d.getVar('DELTA_UPDATE_TYPE') == "rdiff" \
+ else '${SWU_KERNEL_NAME}'}"
+
SWU_IMAGE_FILE ?= "${IMAGE_FULLNAME}"
SWU_DESCRIPTION_FILE ?= "sw-description"
-SWU_ADDITIONAL_FILES ?= "linux.efi ${SWU_ROOTFS_ARTIFACT_NAME}"
+SWU_ADDITIONAL_FILES ?= "${SWU_KERNEL_ARTIFACT_NAME} ${SWU_ROOTFS_ARTIFACT_NAME}"
SWU_SIGNED ??= ""
SWU_SIGNATURE_EXT ?= "sig"
SWU_SIGNATURE_TYPE ?= "cms"
@@ -58,6 +64,7 @@ IMAGE_TEMPLATE_FILES:swu += "${SWU_DESCRIPITION_FILE_BOOTLOADER}.tmpl"
IMAGE_TEMPLATE_VARS:swu = " \
RO_ROOTFS_TYPE \
SWU_ROOTFS_ARTIFACT_NAME \
+ SWU_KERNEL_ARTIFACT_NAME \
TARGET_IMAGE_UUID \
ABROOTFS_PART_UUID_A \
ABROOTFS_PART_UUID_B \
@@ -68,7 +75,8 @@ IMAGE_TEMPLATE_VARS:swu = " \
SWU_FILE_NODES \
SWU_BOOTLOADER_FILE_NODE \
SWU_SCRIPTS_NODE \
- SWU_DELTA_UPDATE_PROPERTIES \
+ SWU_DELTA_UPDATE_ROOTFS_PROPERTIES \
+ SWU_DELTA_UPDATE_KERNEL_PROPERTIES \
"
# TARGET_IMAGE_UUID needs to be generated before completing the template
@@ -163,17 +171,21 @@ python add_scripts_node() {
SWU_EXTEND_SW_DESCRIPTION += "add_swu_delta_update_properties"
python add_swu_delta_update_properties() {
delta_type = d.getVar('DELTA_UPDATE_TYPE')
- swu_delta_update_properties = ""
+ swu_delta_update_rootfs_properties = ""
+ swu_delta_update_kernel_properties = ""
if delta_type == "rdiff":
- swu_delta_update_properties = 'chainhandler = "rdiff_image";'
+ swu_delta_update_rootfs_properties = 'chainhandler = "rdiff_image";'
+ swu_delta_update_kernel_properties = 'chainhandler = "rdiff_file";'
elif delta_type == "zchunk":
zck_url = d.getVar('DELTA_ZCK_URL')
- swu_delta_update_properties = f"""
+ swu_delta_update_rootfs_properties = f"""
chainhandler = "delta";
url = "{zck_url}";
zckloglevel = "error";
"""
- d.setVar('SWU_DELTA_UPDATE_PROPERTIES', swu_delta_update_properties)
+ d.setVar('SWU_DELTA_UPDATE_ROOTFS_PROPERTIES', swu_delta_update_rootfs_properties)
+ d.setVar('SWU_DELTA_UPDATE_KERNEL_PROPERTIES', swu_delta_update_kernel_properties)
+
}
# convert between swupdate compressor name and imagetype extension
diff --git a/recipes-core/images/swu/sw-description.tmpl b/recipes-core/images/swu/sw-description.tmpl
index eeb8fc2..3d7898c 100644
--- a/recipes-core/images/swu/sw-description.tmpl
+++ b/recipes-core/images/swu/sw-description.tmpl
@@ -21,20 +21,21 @@ software =
properties: {
subtype = "image";
configfilecheck = "/etc/os-release@not_match@IMAGE_UUID=${TARGET_IMAGE_UUID}";
- ${SWU_DELTA_UPDATE_PROPERTIES}
+ ${SWU_DELTA_UPDATE_ROOTFS_PROPERTIES}
};
sha256 = "${SWU_ROOTFS_ARTIFACT_NAME}-sha256";
});
files: ({
- filename = "linux.efi";
+ filename = "${SWU_KERNEL_ARTIFACT_NAME}";
path = "linux.efi";
type = "roundrobin";
device = "C:BOOT0:linux.efi->BOOT0,C:BOOT1:linux.efi->BOOT1";
filesystem = "vfat";
properties: {
subtype = "kernel";
+ ${SWU_DELTA_UPDATE_KERNEL_PROPERTIES}
};
- sha256 = "linux.efi-sha256";
+ sha256 = "${SWU_KERNEL_ARTIFACT_NAME}-sha256";
}${SWU_FILE_NODES});
${SWU_SCRIPTS_NODE}
}
--
2.39.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [isar-cip-core][PATCH v1 3/5] README.swupdate.md: Modify readme for kernel binary delta update support.
2025-08-13 13:46 [isar-cip-core][PATCH v1 0/5] Add support for delta kernel binary update Shivanand Kunijadar
2025-08-13 13:46 ` [isar-cip-core][PATCH v1 1/5] delta-update.yml: Add previous image kernel file for rdiff delta update Shivanand Kunijadar
2025-08-13 13:46 ` [isar-cip-core][PATCH v1 2/5] Add delta update support for kernel binary update using rdiff_file handler Shivanand Kunijadar
@ 2025-08-13 13:46 ` Shivanand Kunijadar
2025-08-13 13:46 ` [isar-cip-core][PATCH v1 4/5] swupdate-handler-roundrobin: Update revision for rdiff_file handler support Shivanand Kunijadar
` (2 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Shivanand Kunijadar @ 2025-08-13 13:46 UTC (permalink / raw)
To: cip-dev, jan.kiszka; +Cc: shivanand.kunijadar, dinesh.kumar, kazuhiro3.hayashi
Signed-off-by: Shivanand Kunijadar <Shivanand.Kunijadar@toshiba-tsip.com>
---
doc/README.swupdate.md | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/doc/README.swupdate.md b/doc/README.swupdate.md
index 5308a50..b68b5b7 100644
--- a/doc/README.swupdate.md
+++ b/doc/README.swupdate.md
@@ -408,16 +408,19 @@ host$ ./kas-container build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu
```
The image is built with the RT kernel just so that there are some differences between the two images used. The above image will be used as the base image to which the update is applied.
-## Delta Software Update using rdiff_image handler
+## Delta Software Update using rdiff (rdiff_image & rdiff_file handlers)
-Creating an delta update file for rdiff_image handler requires a reference artifact (against which the delta is computed). In this case, the image built in the previous section can be used as the reference artifact. By default the `DELTA_UPDATE_TYPE` is set to `rdiff` and `DELTA_RDIFF_REF_IMAGE` is set to the name `${IMAGE_FULLNAME}.squashfs` (or ${IMAGE_FULLNAME}.verity in the case of Secure boot enabled image). The values of `DELTA_UPDATE_TYPE` and `DELTA_RDIFF_REF_IMAGE` can be changed in the `delta-update.yml` file.
+**Note**: Only `rdiff` supports delta kernel binary update using `rdiff_file` handler.
+
+Creating an delta update file for rdiff_image (rootfs) and rdiff_file (kernel) handlers requires a reference artifacts (against which the delta is computed). In this case, the image and kernel built in the previous section can be used as the reference artifacts. By default the `DELTA_UPDATE_TYPE` is set to `rdiff`, `DELTA_RDIFF_REF_IMAGE` is set to the name `${IMAGE_FULLNAME}.squashfs` (or ${IMAGE_FULLNAME}.verity in the case of Secure boot enabled image) and `DELTA_RDIFF_REF_KERNEL_IMAGE` is set to the name `linux.efi`. The values of `DELTA_UPDATE_TYPE`, `DELTA_RDIFF_REF_IMAGE` and `DELTA_RDIFF_REF_KERNEL_IMAGE` can be changed in the `delta-update.yml` file.
The build system looks for the reference artifact in a directory named `previous-image` in the build directory used for the build process.
-Copy the reference artifact to the mentioned directory with the following commands:
+Copy the reference artifacts to the mentioned directory with the following commands:
```
mkdir -p build-v2/previous-image
cp build/tmp/deploy/images/qemu-amd64/cip-core-image-cip-core-bookworm-qemu-amd64.squashfs build-v2/previous-image
+cp build/tmp/deploy/images/qemu-amd64/linux.efi build-v2/previous-image
```
Build the second image with `build-v2` as the build directory with the following command:
```
--
2.39.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [isar-cip-core][PATCH v1 4/5] swupdate-handler-roundrobin: Update revision for rdiff_file handler support
2025-08-13 13:46 [isar-cip-core][PATCH v1 0/5] Add support for delta kernel binary update Shivanand Kunijadar
` (2 preceding siblings ...)
2025-08-13 13:46 ` [isar-cip-core][PATCH v1 3/5] README.swupdate.md: Modify readme for kernel binary delta update support Shivanand Kunijadar
@ 2025-08-13 13:46 ` Shivanand Kunijadar
2025-08-13 13:46 ` [isar-cip-core][PATCH v1 5/5] .gitlab-ci.yml: Add linux.efi to previous image folder Shivanand Kunijadar
2025-08-13 14:52 ` [isar-cip-core][PATCH v1 0/5] Add support for delta kernel binary update Jan Kiszka
5 siblings, 0 replies; 10+ messages in thread
From: Shivanand Kunijadar @ 2025-08-13 13:46 UTC (permalink / raw)
To: cip-dev, jan.kiszka; +Cc: shivanand.kunijadar, dinesh.kumar, kazuhiro3.hayashi
This revision includes the support of rdiff_file handler which is helpful to
update the kernel binary files using rdiff.
Signed-off-by: Shivanand Kunijadar <Shivanand.Kunijadar@toshiba-tsip.com>
---
.../swupdate-handler-roundrobin_0.1.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/recipes-core/swupdate-handler-roundrobin/swupdate-handler-roundrobin_0.1.bb b/recipes-core/swupdate-handler-roundrobin/swupdate-handler-roundrobin_0.1.bb
index a185f25..d2edbbd 100644
--- a/recipes-core/swupdate-handler-roundrobin/swupdate-handler-roundrobin_0.1.bb
+++ b/recipes-core/swupdate-handler-roundrobin/swupdate-handler-roundrobin_0.1.bb
@@ -13,7 +13,7 @@ inherit dpkg-raw
PROVIDES = "swupdate-handlers"
SRC_URI += "git://gitlab.com/cip-project/cip-sw-updates/swupdate-handler-roundrobin.git;protocol=https;destsuffix=swupdate-handler-roundrobin;name=swupdate-handler-roundrobin;nobranch=1"
-SRCREV_swupdate-handler-roundrobin ?= "e6936b8c29a20cb6a6893faae57e12499ebbc342"
+SRCREV_swupdate-handler-roundrobin ?= "5deb75df5469c5a66cdd727eb72af83ce0784054"
SWUPDATE_LUASCRIPT = "swupdate-handler-roundrobin/swupdate_handlers_roundrobin.lua"
--
2.39.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [isar-cip-core][PATCH v1 5/5] .gitlab-ci.yml: Add linux.efi to previous image folder
2025-08-13 13:46 [isar-cip-core][PATCH v1 0/5] Add support for delta kernel binary update Shivanand Kunijadar
` (3 preceding siblings ...)
2025-08-13 13:46 ` [isar-cip-core][PATCH v1 4/5] swupdate-handler-roundrobin: Update revision for rdiff_file handler support Shivanand Kunijadar
@ 2025-08-13 13:46 ` Shivanand Kunijadar
2025-08-13 14:52 ` [isar-cip-core][PATCH v1 0/5] Add support for delta kernel binary update Jan Kiszka
5 siblings, 0 replies; 10+ messages in thread
From: Shivanand Kunijadar @ 2025-08-13 13:46 UTC (permalink / raw)
To: cip-dev, jan.kiszka; +Cc: shivanand.kunijadar, dinesh.kumar, kazuhiro3.hayashi
The CI creates rdiff based SWUpdate images by default, so add previous
images kernel file in the previous image folder as well along with
rootfs.
Signed-off-by: Shivanand Kunijadar <Shivanand.Kunijadar@toshiba-tsip.com>
---
.gitlab-ci.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d1b21f5..7f0f450 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -81,6 +81,7 @@ default:
else
cp build/tmp/deploy/images/${target}/*.squashfs build/previous-image;
fi;
+ cp build/tmp/deploy/images/${target}/linux.efi build/previous-image;
echo "PV = \"2.0\"" >> recipes-core/images/cip-core-image-security.bb;
kas build ${base_yaml}:kas/opt/delta-update.yml;
scripts/deploy-cip-core.sh ${release} ${target} ${extension} ${no_kernel} ${dtb} ${CI_COMMIT_REF_SLUG} swu;
--
2.39.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [isar-cip-core][PATCH v1 0/5] Add support for delta kernel binary update
2025-08-13 13:46 [isar-cip-core][PATCH v1 0/5] Add support for delta kernel binary update Shivanand Kunijadar
` (4 preceding siblings ...)
2025-08-13 13:46 ` [isar-cip-core][PATCH v1 5/5] .gitlab-ci.yml: Add linux.efi to previous image folder Shivanand Kunijadar
@ 2025-08-13 14:52 ` Jan Kiszka
2025-08-14 5:28 ` [cip-dev] " Shivanand.Kunijadar
5 siblings, 1 reply; 10+ messages in thread
From: Jan Kiszka @ 2025-08-13 14:52 UTC (permalink / raw)
To: Shivanand Kunijadar, cip-dev; +Cc: dinesh.kumar, kazuhiro3.hayashi
On 13.08.25 15:46, Shivanand Kunijadar wrote:
> This patch series enables the delta kernel binary updates along with
> rootfs. When rdiff is selected it generates deltas for both kernel and rootfs.
>
> In the CI, we just change PV value to 2.0 for the second image and there
> is no change (code) in the kernel binary at the moment. Do you think building
> the second image with RT kernel is appropriate here to verify delta
> kernel updates?
Right, we may need a better delta example for the kernel. I originally
chose that (prior to delta updates) for having changes both in the
kernel and the rootfs that have to correlate. But we actually already
have a link because the ID or hash of the rootfs needs to be stored in
the UKI and, thus, updated in lock-step with the image.
For delta demonstration, we likely need a small change in the rootfs
only. Maybe enable/disable CONFIG_IMAGE_TESTING / kas/opt/test.yml? Or
something artificial and truly small, but that would clutter our menu...
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [cip-dev] [isar-cip-core][PATCH v1 0/5] Add support for delta kernel binary update
2025-08-13 14:52 ` [isar-cip-core][PATCH v1 0/5] Add support for delta kernel binary update Jan Kiszka
@ 2025-08-14 5:28 ` Shivanand.Kunijadar
0 siblings, 0 replies; 10+ messages in thread
From: Shivanand.Kunijadar @ 2025-08-14 5:28 UTC (permalink / raw)
To: jan.kiszka, cip-dev; +Cc: dinesh.kumar, kazuhiro3.hayashi
Hi Jan,
Thanks for the reply.
>Right, we may need a better delta example for the kernel. I originally chose that (prior to delta updates) for having changes both in the >kernel and the rootfs that have to correlate. But we actually already have a link because the ID or hash of the rootfs needs to be stored >in the UKI and, thus, updated in lock-step with the image.
Yes, even though if no change in the kernel, there will be a minor change in UKI because of the rootfs hash value.
And also if we think from the practical update scenarios, we likely update for only kernel minor version changes not entirely kernel itself (Non-RT to RT as I mentioned previously). So in the current CI, it is difficult (needs a separate .bb recipe) to build a second image with change in kernel minor version and also it needs to rebuild the entire kernel second time in the CI so it increases the CI build time.
By considering all these points, I feel the current approach of changing PV which leads to minor change in UKI is fine.
what do you think?
>For delta demonstration, we likely need a small change in the rootfs only. Maybe enable/disable CONFIG_IMAGE_TESTING / >kas/opt/test.yml? Or something artificial and truly small, but that would clutter our menu...
Yeah that's correct.
Thanks & Regards
Shivanand K
-----Original Message-----
From: cip-dev@lists.cip-project.org <cip-dev@lists.cip-project.org> On Behalf Of Jan Kiszka via lists.cip-project.org
Sent: 13 August 2025 20:22
To: kunijadar shivanand(TSIP DITC_DIT-OST) <Shivanand.Kunijadar@toshiba-tsip.com>; cip-dev@lists.cip-project.org
Cc: dinesh kumar(TSIP DITC_DIT-OST) <dinesh.kumar@toshiba-tsip.com>; hayashi kazuhiro(林 和宏 □DITC○CPT) <kazuhiro3.hayashi@toshiba.co.jp>
Subject: Re: [cip-dev] [isar-cip-core][PATCH v1 0/5] Add support for delta kernel binary update
On 13.08.25 15:46, Shivanand Kunijadar wrote:
> This patch series enables the delta kernel binary updates along with
> rootfs. When rdiff is selected it generates deltas for both kernel and rootfs.
>
> In the CI, we just change PV value to 2.0 for the second image and
> there is no change (code) in the kernel binary at the moment. Do you
> think building the second image with RT kernel is appropriate here to
> verify delta kernel updates?
Right, we may need a better delta example for the kernel. I originally chose that (prior to delta updates) for having changes both in the kernel and the rootfs that have to correlate. But we actually already have a link because the ID or hash of the rootfs needs to be stored in the UKI and, thus, updated in lock-step with the image.
For delta demonstration, we likely need a small change in the rootfs only. Maybe enable/disable CONFIG_IMAGE_TESTING / kas/opt/test.yml? Or something artificial and truly small, but that would clutter our menu...
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [isar-cip-core][PATCH v1 2/5] Add delta update support for kernel binary update using rdiff_file handler
2025-08-13 13:46 ` [isar-cip-core][PATCH v1 2/5] Add delta update support for kernel binary update using rdiff_file handler Shivanand Kunijadar
@ 2025-08-14 10:08 ` Jan Kiszka
2025-08-14 10:13 ` Shivanand.Kunijadar
0 siblings, 1 reply; 10+ messages in thread
From: Jan Kiszka @ 2025-08-14 10:08 UTC (permalink / raw)
To: Shivanand Kunijadar, cip-dev; +Cc: dinesh.kumar, kazuhiro3.hayashi
Don't you need to update the handler first (patch 4)? It's unclear to me
from reading the changes below what will happen when the old hander is
used. Please reorder or clarify here via a commit message.
On 13.08.25 15:46, Shivanand Kunijadar wrote:
> Signed-off-by: Shivanand Kunijadar <Shivanand.Kunijadar@toshiba-tsip.com>
> ---
> classes/delta-update.bbclass | 33 +++++++++++++++------
> classes/swupdate.bbclass | 24 +++++++++++----
> recipes-core/images/swu/sw-description.tmpl | 7 +++--
> 3 files changed, 46 insertions(+), 18 deletions(-)
>
> diff --git a/classes/delta-update.bbclass b/classes/delta-update.bbclass
> index ab11be5..d033df0 100644
> --- a/classes/delta-update.bbclass
> +++ b/classes/delta-update.bbclass
> @@ -15,6 +15,7 @@ FILESEXTRAPATHS:prepend = "${TOPDIR}/previous-image:"
>
> DELTA_UPDATE_TYPE ??= ""
> DELTA_RDIFF_REF_IMAGE ??= ""
> +DELTA_RDIFF_REF_KERNEL_IMAGE ??= ""
> DELTA_ZCK_URL ??= ""
> DELTA_PREV_IMAGE_PATH ??= "${TOPDIR}/previous-image"
>
> @@ -24,8 +25,8 @@ def disable_delta_update_tasks (d):
>
> python () {
> if d.getVar("DELTA_UPDATE_TYPE") == "rdiff":
> - if d.getVar("DELTA_RDIFF_REF_IMAGE") == "":
> - bb.fatal("You must set DELTA_RDIFF_REF_IMAGE and provide the required files as artifacts to this recipe")
> + if d.getVar("DELTA_RDIFF_REF_IMAGE") == "" or d.getVar("DELTA_RDIFF_REF_KERNEL_IMAGE") == "":
> + bb.fatal("You must set DELTA_RDIFF_REF_IMAGE and DELTA_RDIFF_REF_KERNEL_IMAGE and also provide the required files as artifacts to this recipe")
> elif d.getVar("DELTA_UPDATE_TYPE") == "zchunk":
> if d.getVar("BASE_DISTRO_CODENAME") != "trixie":
> bb.fatal("Zchunk based delta update is only supported from trixie onward")
> @@ -35,11 +36,13 @@ python () {
>
> python do_fetch_delta_rdiff_ref_image () {
> if d.getVar("DELTA_UPDATE_TYPE") == "rdiff":
> - path = d.getVar("DELTA_PREV_IMAGE_PATH") + "/" + d.getVar("DELTA_RDIFF_REF_IMAGE")
> - if not os.path.isfile(path):
> - bb.fatal("No such file found: "+ path + ". Provide the required files at "+ d.getVar("DELTA_PREV_IMAGE_PATH") + " for rdiff based delta update")
> + rootfs_path = d.getVar("DELTA_PREV_IMAGE_PATH") + "/" + d.getVar("DELTA_RDIFF_REF_IMAGE")
> + kernel_path = d.getVar("DELTA_PREV_IMAGE_PATH") + "/" + d.getVar("DELTA_RDIFF_REF_KERNEL_IMAGE")
> + if not os.path.isfile(rootfs_path) or not os.path.isfile(kernel_path):
> + bb.fatal("No such files found: "+ rootfs_path + "," + kernel_path + ". Provide the required files at "+ d.getVar("DELTA_PREV_IMAGE_PATH") + " for rdiff based delta update")
> else:
> d.appendVar("SRC_URI", " file://" + d.getVar("DELTA_RDIFF_REF_IMAGE"))
> + d.appendVar("SRC_URI", " file://" + d.getVar("DELTA_RDIFF_REF_KERNEL_IMAGE"))
> }
>
> do_fetch[prefuncs] += "do_fetch_delta_rdiff_ref_image"
> @@ -47,18 +50,30 @@ do_unpack[prefuncs] += "do_fetch_delta_rdiff_ref_image"
>
> create_rdiff_delta_artifact() {
> rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.delta
> - # create signature file with rdiff
> + # create signature file with rdiff for rootfs
> ${SUDO_CHROOT} /usr/bin/rdiff signature ${WORKDIR}/${DELTA_RDIFF_REF_IMAGE} \
> ${WORKDIR}/delta_interim_artifacts/old-image-rootfs.sig
>
> - # create delta file with the signature file
> + # create delta file with the signature file for rootfs
> ${SUDO_CHROOT} /usr/bin/rdiff delta ${WORKDIR}/delta_interim_artifacts/old-image-rootfs.sig \
> ${PP_DEPLOY}/${IMAGE_FULLNAME}.${SWU_ROOTFS_TYPE} ${PP_DEPLOY}/${IMAGE_FULLNAME}.delta
>
> - DELTA_ARTIFACT_SWU=${IMAGE_FULLNAME}.delta
> + DELTA_ARTIFACT_ROOTFS_SWU=${IMAGE_FULLNAME}.delta
>
> # create a symbolic link as IMAGE_CMD expects a *.delta_update file in deploy image directory
> - ln -sf ${DELTA_ARTIFACT_SWU} ${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.delta_update
> + ln -sf ${DELTA_ARTIFACT_ROOTFS_SWU} ${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.delta_update
> +
> + rm -f ${DEPLOY_DIR_IMAGE}/linux.efi.delta
> +
> + # create signature file with rdiff for kernel
> + ${SUDO_CHROOT} /usr/bin/rdiff signature ${WORKDIR}/${DELTA_RDIFF_REF_KERNEL_IMAGE} \
> + ${WORKDIR}/delta_interim_artifacts/old-linux.efi.sig
> +
> + # create delta file with the signature file for kernel
> + ${SUDO_CHROOT} /usr/bin/rdiff delta ${WORKDIR}/delta_interim_artifacts/old-linux.efi.sig \
> + ${PP_DEPLOY}/linux.efi ${PP_DEPLOY}/linux.efi.delta
> +
> + ln -sf linux.efi.delta ${DEPLOY_DIR_IMAGE}/linux.efi.delta_update
> }
>
> create_zchunk_delta_artifact() {
> diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass
> index b0b05d5..c18aaa9 100644
> --- a/classes/swupdate.bbclass
> +++ b/classes/swupdate.bbclass
> @@ -15,6 +15,7 @@ inherit template
> RO_ROOTFS_TYPE ??= "squashfs"
> SWU_ROOTFS_TYPE ?= "${RO_ROOTFS_TYPE}"
> SWU_ROOTFS_NAME ?= "${IMAGE_FULLNAME}"
> +SWU_KERNEL_NAME ?= "linux.efi"
> # compression type as defined by swupdate (zlib or zstd). Set to empty string to disable compression
> SWU_COMPRESSION_TYPE ?= "zlib"
> SWU_ROOTFS_PARTITION_NAME ?= "${SWU_ROOTFS_NAME}.${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
> @@ -32,9 +33,14 @@ SWU_ROOTFS_ARTIFACT_NAME = "${@ '${SWU_DELTA_UPDATE_ARTIFACT}' \
> if d.getVar('DELTA_UPDATE_TYPE') == "rdiff" or d.getVar('DELTA_UPDATE_TYPE') == "zchunk" \
> else '${SWU_ROOTFS_PARTITION_NAME}'}"
>
> +SWU_DELTA_UPDATE_KERNEL_ARTIFACT = "${SWU_KERNEL_NAME}.delta_update"
> +SWU_KERNEL_ARTIFACT_NAME = "${@ '${SWU_DELTA_UPDATE_KERNEL_ARTIFACT}' \
> + if d.getVar('DELTA_UPDATE_TYPE') == "rdiff" \
> + else '${SWU_KERNEL_NAME}'}"
> +
> SWU_IMAGE_FILE ?= "${IMAGE_FULLNAME}"
> SWU_DESCRIPTION_FILE ?= "sw-description"
> -SWU_ADDITIONAL_FILES ?= "linux.efi ${SWU_ROOTFS_ARTIFACT_NAME}"
> +SWU_ADDITIONAL_FILES ?= "${SWU_KERNEL_ARTIFACT_NAME} ${SWU_ROOTFS_ARTIFACT_NAME}"
> SWU_SIGNED ??= ""
> SWU_SIGNATURE_EXT ?= "sig"
> SWU_SIGNATURE_TYPE ?= "cms"
> @@ -58,6 +64,7 @@ IMAGE_TEMPLATE_FILES:swu += "${SWU_DESCRIPITION_FILE_BOOTLOADER}.tmpl"
> IMAGE_TEMPLATE_VARS:swu = " \
> RO_ROOTFS_TYPE \
> SWU_ROOTFS_ARTIFACT_NAME \
> + SWU_KERNEL_ARTIFACT_NAME \
> TARGET_IMAGE_UUID \
> ABROOTFS_PART_UUID_A \
> ABROOTFS_PART_UUID_B \
> @@ -68,7 +75,8 @@ IMAGE_TEMPLATE_VARS:swu = " \
> SWU_FILE_NODES \
> SWU_BOOTLOADER_FILE_NODE \
> SWU_SCRIPTS_NODE \
> - SWU_DELTA_UPDATE_PROPERTIES \
> + SWU_DELTA_UPDATE_ROOTFS_PROPERTIES \
> + SWU_DELTA_UPDATE_KERNEL_PROPERTIES \
> "
>
> # TARGET_IMAGE_UUID needs to be generated before completing the template
> @@ -163,17 +171,21 @@ python add_scripts_node() {
> SWU_EXTEND_SW_DESCRIPTION += "add_swu_delta_update_properties"
> python add_swu_delta_update_properties() {
> delta_type = d.getVar('DELTA_UPDATE_TYPE')
> - swu_delta_update_properties = ""
> + swu_delta_update_rootfs_properties = ""
> + swu_delta_update_kernel_properties = ""
> if delta_type == "rdiff":
> - swu_delta_update_properties = 'chainhandler = "rdiff_image";'
> + swu_delta_update_rootfs_properties = 'chainhandler = "rdiff_image";'
> + swu_delta_update_kernel_properties = 'chainhandler = "rdiff_file";'
> elif delta_type == "zchunk":
> zck_url = d.getVar('DELTA_ZCK_URL')
> - swu_delta_update_properties = f"""
> + swu_delta_update_rootfs_properties = f"""
> chainhandler = "delta";
> url = "{zck_url}";
> zckloglevel = "error";
> """
> - d.setVar('SWU_DELTA_UPDATE_PROPERTIES', swu_delta_update_properties)
> + d.setVar('SWU_DELTA_UPDATE_ROOTFS_PROPERTIES', swu_delta_update_rootfs_properties)
> + d.setVar('SWU_DELTA_UPDATE_KERNEL_PROPERTIES', swu_delta_update_kernel_properties)
> +
> }
>
> # convert between swupdate compressor name and imagetype extension
> diff --git a/recipes-core/images/swu/sw-description.tmpl b/recipes-core/images/swu/sw-description.tmpl
> index eeb8fc2..3d7898c 100644
> --- a/recipes-core/images/swu/sw-description.tmpl
> +++ b/recipes-core/images/swu/sw-description.tmpl
> @@ -21,20 +21,21 @@ software =
> properties: {
> subtype = "image";
> configfilecheck = "/etc/os-release@not_match@IMAGE_UUID=${TARGET_IMAGE_UUID}";
> - ${SWU_DELTA_UPDATE_PROPERTIES}
> + ${SWU_DELTA_UPDATE_ROOTFS_PROPERTIES}
> };
> sha256 = "${SWU_ROOTFS_ARTIFACT_NAME}-sha256";
> });
> files: ({
> - filename = "linux.efi";
> + filename = "${SWU_KERNEL_ARTIFACT_NAME}";
> path = "linux.efi";
> type = "roundrobin";
> device = "C:BOOT0:linux.efi->BOOT0,C:BOOT1:linux.efi->BOOT1";
> filesystem = "vfat";
> properties: {
> subtype = "kernel";
> + ${SWU_DELTA_UPDATE_KERNEL_PROPERTIES}
> };
> - sha256 = "linux.efi-sha256";
> + sha256 = "${SWU_KERNEL_ARTIFACT_NAME}-sha256";
> }${SWU_FILE_NODES});
> ${SWU_SCRIPTS_NODE}
> }
Looks good otherwise.
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [isar-cip-core][PATCH v1 2/5] Add delta update support for kernel binary update using rdiff_file handler
2025-08-14 10:08 ` Jan Kiszka
@ 2025-08-14 10:13 ` Shivanand.Kunijadar
0 siblings, 0 replies; 10+ messages in thread
From: Shivanand.Kunijadar @ 2025-08-14 10:13 UTC (permalink / raw)
To: jan.kiszka, cip-dev; +Cc: dinesh.kumar, kazuhiro3.hayashi
Hi Jan,
> Don't you need to update the handler first (patch 4)? It's unclear to me from reading the changes below what will happen when the old hander is used. Please reorder or clarify here via a commit message.
Ah, that's a valid point. The RR handler revision update patch should be the first one. Let me send the v2 patch series.
Thanks & Regards
Shivanand K
-----Original Message-----
From: Jan Kiszka <jan.kiszka@siemens.com>
Sent: 14 August 2025 15:38
To: kunijadar shivanand(TSIP DITC_DIT-OST) <Shivanand.Kunijadar@toshiba-tsip.com>; cip-dev@lists.cip-project.org
Cc: dinesh kumar(TSIP DITC_DIT-OST) <dinesh.kumar@toshiba-tsip.com>; hayashi kazuhiro(林 和宏 □DITC○CPT) <kazuhiro3.hayashi@toshiba.co.jp>
Subject: Re: [isar-cip-core][PATCH v1 2/5] Add delta update support for kernel binary update using rdiff_file handler
Don't you need to update the handler first (patch 4)? It's unclear to me from reading the changes below what will happen when the old hander is used. Please reorder or clarify here via a commit message.
On 13.08.25 15:46, Shivanand Kunijadar wrote:
> Signed-off-by: Shivanand Kunijadar
> <Shivanand.Kunijadar@toshiba-tsip.com>
> ---
> classes/delta-update.bbclass | 33 +++++++++++++++------
> classes/swupdate.bbclass | 24 +++++++++++----
> recipes-core/images/swu/sw-description.tmpl | 7 +++--
> 3 files changed, 46 insertions(+), 18 deletions(-)
>
> diff --git a/classes/delta-update.bbclass
> b/classes/delta-update.bbclass index ab11be5..d033df0 100644
> --- a/classes/delta-update.bbclass
> +++ b/classes/delta-update.bbclass
> @@ -15,6 +15,7 @@ FILESEXTRAPATHS:prepend = "${TOPDIR}/previous-image:"
>
> DELTA_UPDATE_TYPE ??= ""
> DELTA_RDIFF_REF_IMAGE ??= ""
> +DELTA_RDIFF_REF_KERNEL_IMAGE ??= ""
> DELTA_ZCK_URL ??= ""
> DELTA_PREV_IMAGE_PATH ??= "${TOPDIR}/previous-image"
>
> @@ -24,8 +25,8 @@ def disable_delta_update_tasks (d):
>
> python () {
> if d.getVar("DELTA_UPDATE_TYPE") == "rdiff":
> - if d.getVar("DELTA_RDIFF_REF_IMAGE") == "":
> - bb.fatal("You must set DELTA_RDIFF_REF_IMAGE and provide the required files as artifacts to this recipe")
> + if d.getVar("DELTA_RDIFF_REF_IMAGE") == "" or d.getVar("DELTA_RDIFF_REF_KERNEL_IMAGE") == "":
> + bb.fatal("You must set DELTA_RDIFF_REF_IMAGE and
> + DELTA_RDIFF_REF_KERNEL_IMAGE and also provide the required files as
> + artifacts to this recipe")
> elif d.getVar("DELTA_UPDATE_TYPE") == "zchunk":
> if d.getVar("BASE_DISTRO_CODENAME") != "trixie":
> bb.fatal("Zchunk based delta update is only supported
> from trixie onward") @@ -35,11 +36,13 @@ python () {
>
> python do_fetch_delta_rdiff_ref_image () {
> if d.getVar("DELTA_UPDATE_TYPE") == "rdiff":
> - path = d.getVar("DELTA_PREV_IMAGE_PATH") + "/" + d.getVar("DELTA_RDIFF_REF_IMAGE")
> - if not os.path.isfile(path):
> - bb.fatal("No such file found: "+ path + ". Provide the required files at "+ d.getVar("DELTA_PREV_IMAGE_PATH") + " for rdiff based delta update")
> + rootfs_path = d.getVar("DELTA_PREV_IMAGE_PATH") + "/" + d.getVar("DELTA_RDIFF_REF_IMAGE")
> + kernel_path = d.getVar("DELTA_PREV_IMAGE_PATH") + "/" + d.getVar("DELTA_RDIFF_REF_KERNEL_IMAGE")
> + if not os.path.isfile(rootfs_path) or not os.path.isfile(kernel_path):
> + bb.fatal("No such files found: "+ rootfs_path + "," +
> + kernel_path + ". Provide the required files at "+
> + d.getVar("DELTA_PREV_IMAGE_PATH") + " for rdiff based delta update")
> else:
> d.appendVar("SRC_URI", " file://" +
> d.getVar("DELTA_RDIFF_REF_IMAGE"))
> + d.appendVar("SRC_URI", " file://" +
> + d.getVar("DELTA_RDIFF_REF_KERNEL_IMAGE"))
> }
>
> do_fetch[prefuncs] += "do_fetch_delta_rdiff_ref_image"
> @@ -47,18 +50,30 @@ do_unpack[prefuncs] += "do_fetch_delta_rdiff_ref_image"
>
> create_rdiff_delta_artifact() {
> rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.delta
> - # create signature file with rdiff
> + # create signature file with rdiff for rootfs
> ${SUDO_CHROOT} /usr/bin/rdiff signature ${WORKDIR}/${DELTA_RDIFF_REF_IMAGE} \
> ${WORKDIR}/delta_interim_artifacts/old-image-rootfs.sig
>
> - # create delta file with the signature file
> + # create delta file with the signature file for rootfs
> ${SUDO_CHROOT} /usr/bin/rdiff delta ${WORKDIR}/delta_interim_artifacts/old-image-rootfs.sig \
> ${PP_DEPLOY}/${IMAGE_FULLNAME}.${SWU_ROOTFS_TYPE}
> ${PP_DEPLOY}/${IMAGE_FULLNAME}.delta
>
> - DELTA_ARTIFACT_SWU=${IMAGE_FULLNAME}.delta
> + DELTA_ARTIFACT_ROOTFS_SWU=${IMAGE_FULLNAME}.delta
>
> # create a symbolic link as IMAGE_CMD expects a *.delta_update file in deploy image directory
> - ln -sf ${DELTA_ARTIFACT_SWU} ${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.delta_update
> + ln -sf ${DELTA_ARTIFACT_ROOTFS_SWU}
> + ${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.delta_update
> +
> + rm -f ${DEPLOY_DIR_IMAGE}/linux.efi.delta
> +
> + # create signature file with rdiff for kernel
> + ${SUDO_CHROOT} /usr/bin/rdiff signature ${WORKDIR}/${DELTA_RDIFF_REF_KERNEL_IMAGE} \
> + ${WORKDIR}/delta_interim_artifacts/old-linux.efi.sig
> +
> + # create delta file with the signature file for kernel
> + ${SUDO_CHROOT} /usr/bin/rdiff delta ${WORKDIR}/delta_interim_artifacts/old-linux.efi.sig \
> + ${PP_DEPLOY}/linux.efi ${PP_DEPLOY}/linux.efi.delta
> +
> + ln -sf linux.efi.delta ${DEPLOY_DIR_IMAGE}/linux.efi.delta_update
> }
>
> create_zchunk_delta_artifact() {
> diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass index
> b0b05d5..c18aaa9 100644
> --- a/classes/swupdate.bbclass
> +++ b/classes/swupdate.bbclass
> @@ -15,6 +15,7 @@ inherit template
> RO_ROOTFS_TYPE ??= "squashfs"
> SWU_ROOTFS_TYPE ?= "${RO_ROOTFS_TYPE}"
> SWU_ROOTFS_NAME ?= "${IMAGE_FULLNAME}"
> +SWU_KERNEL_NAME ?= "linux.efi"
> # compression type as defined by swupdate (zlib or zstd). Set to
> empty string to disable compression SWU_COMPRESSION_TYPE ?= "zlib"
> SWU_ROOTFS_PARTITION_NAME ?= "${SWU_ROOTFS_NAME}.${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
> @@ -32,9 +33,14 @@ SWU_ROOTFS_ARTIFACT_NAME = "${@ '${SWU_DELTA_UPDATE_ARTIFACT}' \
> if d.getVar('DELTA_UPDATE_TYPE') == "rdiff" or d.getVar('DELTA_UPDATE_TYPE') == "zchunk" \
> else '${SWU_ROOTFS_PARTITION_NAME}'}"
>
> +SWU_DELTA_UPDATE_KERNEL_ARTIFACT = "${SWU_KERNEL_NAME}.delta_update"
> +SWU_KERNEL_ARTIFACT_NAME = "${@ '${SWU_DELTA_UPDATE_KERNEL_ARTIFACT}' \
> + if d.getVar('DELTA_UPDATE_TYPE') == "rdiff" \
> + else '${SWU_KERNEL_NAME}'}"
> +
> SWU_IMAGE_FILE ?= "${IMAGE_FULLNAME}"
> SWU_DESCRIPTION_FILE ?= "sw-description"
> -SWU_ADDITIONAL_FILES ?= "linux.efi ${SWU_ROOTFS_ARTIFACT_NAME}"
> +SWU_ADDITIONAL_FILES ?= "${SWU_KERNEL_ARTIFACT_NAME} ${SWU_ROOTFS_ARTIFACT_NAME}"
> SWU_SIGNED ??= ""
> SWU_SIGNATURE_EXT ?= "sig"
> SWU_SIGNATURE_TYPE ?= "cms"
> @@ -58,6 +64,7 @@ IMAGE_TEMPLATE_FILES:swu += "${SWU_DESCRIPITION_FILE_BOOTLOADER}.tmpl"
> IMAGE_TEMPLATE_VARS:swu = " \
> RO_ROOTFS_TYPE \
> SWU_ROOTFS_ARTIFACT_NAME \
> + SWU_KERNEL_ARTIFACT_NAME \
> TARGET_IMAGE_UUID \
> ABROOTFS_PART_UUID_A \
> ABROOTFS_PART_UUID_B \
> @@ -68,7 +75,8 @@ IMAGE_TEMPLATE_VARS:swu = " \
> SWU_FILE_NODES \
> SWU_BOOTLOADER_FILE_NODE \
> SWU_SCRIPTS_NODE \
> - SWU_DELTA_UPDATE_PROPERTIES \
> + SWU_DELTA_UPDATE_ROOTFS_PROPERTIES \
> + SWU_DELTA_UPDATE_KERNEL_PROPERTIES \
> "
>
> # TARGET_IMAGE_UUID needs to be generated before completing the
> template @@ -163,17 +171,21 @@ python add_scripts_node() {
> SWU_EXTEND_SW_DESCRIPTION += "add_swu_delta_update_properties"
> python add_swu_delta_update_properties() {
> delta_type = d.getVar('DELTA_UPDATE_TYPE')
> - swu_delta_update_properties = ""
> + swu_delta_update_rootfs_properties = ""
> + swu_delta_update_kernel_properties = ""
> if delta_type == "rdiff":
> - swu_delta_update_properties = 'chainhandler = "rdiff_image";'
> + swu_delta_update_rootfs_properties = 'chainhandler = "rdiff_image";'
> + swu_delta_update_kernel_properties = 'chainhandler = "rdiff_file";'
> elif delta_type == "zchunk":
> zck_url = d.getVar('DELTA_ZCK_URL')
> - swu_delta_update_properties = f"""
> + swu_delta_update_rootfs_properties = f"""
> chainhandler = "delta";
> url = "{zck_url}";
> zckloglevel = "error";
> """
> - d.setVar('SWU_DELTA_UPDATE_PROPERTIES', swu_delta_update_properties)
> + d.setVar('SWU_DELTA_UPDATE_ROOTFS_PROPERTIES', swu_delta_update_rootfs_properties)
> + d.setVar('SWU_DELTA_UPDATE_KERNEL_PROPERTIES',
> + swu_delta_update_kernel_properties)
> +
> }
>
> # convert between swupdate compressor name and imagetype extension
> diff --git a/recipes-core/images/swu/sw-description.tmpl
> b/recipes-core/images/swu/sw-description.tmpl
> index eeb8fc2..3d7898c 100644
> --- a/recipes-core/images/swu/sw-description.tmpl
> +++ b/recipes-core/images/swu/sw-description.tmpl
> @@ -21,20 +21,21 @@ software =
> properties: {
> subtype = "image";
> configfilecheck = "/etc/os-release@not_match@IMAGE_UUID=${TARGET_IMAGE_UUID}";
> - ${SWU_DELTA_UPDATE_PROPERTIES}
> + ${SWU_DELTA_UPDATE_ROOTFS_PROPERTIES}
> };
> sha256 = "${SWU_ROOTFS_ARTIFACT_NAME}-sha256";
> });
> files: ({
> - filename = "linux.efi";
> + filename = "${SWU_KERNEL_ARTIFACT_NAME}";
> path = "linux.efi";
> type = "roundrobin";
> device = "C:BOOT0:linux.efi->BOOT0,C:BOOT1:linux.efi->BOOT1";
> filesystem = "vfat";
> properties: {
> subtype = "kernel";
> + ${SWU_DELTA_UPDATE_KERNEL_PROPERTIES}
> };
> - sha256 = "linux.efi-sha256";
> + sha256 = "${SWU_KERNEL_ARTIFACT_NAME}-sha256";
> }${SWU_FILE_NODES});
> ${SWU_SCRIPTS_NODE}
> }
Looks good otherwise.
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-08-14 10:13 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13 13:46 [isar-cip-core][PATCH v1 0/5] Add support for delta kernel binary update Shivanand Kunijadar
2025-08-13 13:46 ` [isar-cip-core][PATCH v1 1/5] delta-update.yml: Add previous image kernel file for rdiff delta update Shivanand Kunijadar
2025-08-13 13:46 ` [isar-cip-core][PATCH v1 2/5] Add delta update support for kernel binary update using rdiff_file handler Shivanand Kunijadar
2025-08-14 10:08 ` Jan Kiszka
2025-08-14 10:13 ` Shivanand.Kunijadar
2025-08-13 13:46 ` [isar-cip-core][PATCH v1 3/5] README.swupdate.md: Modify readme for kernel binary delta update support Shivanand Kunijadar
2025-08-13 13:46 ` [isar-cip-core][PATCH v1 4/5] swupdate-handler-roundrobin: Update revision for rdiff_file handler support Shivanand Kunijadar
2025-08-13 13:46 ` [isar-cip-core][PATCH v1 5/5] .gitlab-ci.yml: Add linux.efi to previous image folder Shivanand Kunijadar
2025-08-13 14:52 ` [isar-cip-core][PATCH v1 0/5] Add support for delta kernel binary update Jan Kiszka
2025-08-14 5:28 ` [cip-dev] " Shivanand.Kunijadar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox