* [PATCH v11 1/3] meta: Fix do_copy_boot_files error for different distros of same machine
2026-06-09 8:44 [PATCH v11 0/3] Move kernel artifacts deployment from image recipe Anton Mikanovich
@ 2026-06-09 8:44 ` Anton Mikanovich
2026-06-09 8:44 ` [PATCH v11 2/3] meta: Move kernel artifacts deployment from image recipe Anton Mikanovich
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Anton Mikanovich @ 2026-06-09 8:44 UTC (permalink / raw)
To: isar-users; +Cc: Anton Mikanovich
When building different distros for the same machine (e.g.,
phyboard-mira-bullseye and phyboard-mira-bookworm), files with the same
name (e.g, DTB files) might be deployed to the same location and this
causes a build error.
Use DISTRO-dependent deploy directory as a fix.
Also fix paths in installer and testsuite.
Fixes test_dtb_deploy_distros testcase:
ERROR: mc:phyboard-mira-bookworm:isar-image-base-1.0-r0 do_copy_boot_files: The recipe isar-image-base is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
NOTE: recipe isar-image-base-1.0-r0: task do_copy_boot_files: Failed
build/tmp/deploy/images/phyboard-mira/imx6q-phytec-mira-rdk-nand.dtb
(not matched to any task)
Please verify which recipe should provide the above files.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
RECIPE-API-CHANGELOG.md | 15 +++++++++++++++
.../classes-recipe/installer-add-rootfs.bbclass | 2 +-
meta/conf/bitbake.conf | 2 +-
testsuite/citest.py | 12 +++++-------
4 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 5d2514c0..a6ded089 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -1087,3 +1087,18 @@ and `arch=all` binary packages). Recipes for such mixed packages should append
`PROVIDES="foo-doc-archall"` for an `arch=all` binary package `foo-doc`).
Consumers can then simply reference the package by its original name (e.g.,
`foo-doc`).
+
+### Change DEPLOY_DIR_IMAGE path
+
+Change DEPLOY_DIR_IMAGE from ${DEPLOY_DIR}/images/${MACHINE} to
+${DEPLOY_DIR}/images/${MACHINE}-${DISTRO}. When building different distros
+with the same machine the following error occurs:
+
+do_copy_boot_files: The recipe isar-image-base is trying to install files
+into a shared area when those files already exists. It happens when some
+files have the same names (e.g., dtb files) for different distros.
+
+To prevent this new path is separated also by distro and kernel values.
+
+This change will influence on build artifacts location and should be taken
+into account by downstreams.
diff --git a/meta-isar/classes-recipe/installer-add-rootfs.bbclass b/meta-isar/classes-recipe/installer-add-rootfs.bbclass
index 111506df..22c23879 100644
--- a/meta-isar/classes-recipe/installer-add-rootfs.bbclass
+++ b/meta-isar/classes-recipe/installer-add-rootfs.bbclass
@@ -13,7 +13,7 @@ INSTALLER_TARGET_IMAGES ??= "${INSTALLER_TARGET_IMAGE}"
INSTALLER_TARGET_MC ??= "installer-target"
INSTALLER_TARGET_DISTRO ??= "${DISTRO}"
INSTALLER_TARGET_MACHINE ??= "${MACHINE}"
-INSTALLER_TARGET_DEPLOY_DIR_IMAGE ??= "${DEPLOY_DIR}/images/${INSTALLER_TARGET_MACHINE}"
+INSTALLER_TARGET_DEPLOY_DIR_IMAGE ??= "${DEPLOY_DIR}/images/${INSTALLER_TARGET_MACHINE}-${INSTALLER_TARGET_DISTRO}"
IMAGE_DATA_FILE ??= "${INSTALLER_TARGET_IMAGE}-${INSTALLER_TARGET_DISTRO}-${INSTALLER_TARGET_MACHINE}"
IMAGE_DATA_POSTFIX ??= "wic.zst"
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 6db10eb3..8134c10c 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -57,7 +57,7 @@ WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}/${PV}-${PR}"
GIT_DL_LINK_DIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}"
DEPLOY_DIR_BOOTSTRAP = "${DEPLOY_DIR}/bootstrap"
DEPLOY_DIR_SDKCHROOT = "${DEPLOY_DIR}/sdkchroot"
-DEPLOY_DIR_IMAGE = "${DEPLOY_DIR}/images/${MACHINE}"
+DEPLOY_DIR_IMAGE = "${DEPLOY_DIR}/images/${MACHINE}-${DISTRO}"
DL_DIR ?= "${TOPDIR}/downloads"
SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
SSTATE_MANIFESTS = "${TMPDIR}/sstate-control/${DISTRO}-${DISTRO_ARCH}"
diff --git a/testsuite/citest.py b/testsuite/citest.py
index 250c01c6..7d666880 100644
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -522,8 +522,9 @@ class InitRdBaseTest(CIBaseTest):
super().init()
self.deploy_dir = os.path.join(self.build_dir, 'tmp', 'deploy')
- def deploy_dir_image(self, machine):
- return os.path.join(self.deploy_dir, 'images', machine)
+ def deploy_dir_image(self, mc, image):
+ multiconfig = f"{mc}:{image}"
+ return CIUtils.getVars('DEPLOY_DIR_IMAGE', target=multiconfig)
def dracut_in_image(self, targets):
machine = 'qemuamd64'
@@ -555,7 +556,7 @@ class InitRdBaseTest(CIBaseTest):
bb_should_fail=False):
mc = f'mc:{machine}-{distro.removeprefix("debian-")}'
initrd_image = f'{initrd}-{distro}-{machine}-initrd.img'
- initrd_path = os.path.join(self.deploy_dir_image(machine), initrd_image)
+ initrd_path = os.path.join(self.deploy_dir_image(mc, initrd), initrd_image)
# cleansstate if the initrd image was already built/deployed to verify
# that a new build does result in the image being deployed
@@ -725,10 +726,7 @@ class DtbDeployTest(CIBaseTest):
self.init()
self.move_in_build_dir('tmp', 'tmp_before_dtbdeploy')
- try:
- self.perform_build_test(targets, image_install='')
- except exceptions.TestFail:
- self.cancel('KFAIL')
+ self.perform_build_test(targets, image_install='')
def test_dtb_deploy_images(self):
"""
--
2.34.1
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260609084422.3948645-2-amikan%40ilbers.de.
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH v11 2/3] meta: Move kernel artifacts deployment from image recipe
2026-06-09 8:44 [PATCH v11 0/3] Move kernel artifacts deployment from image recipe Anton Mikanovich
2026-06-09 8:44 ` [PATCH v11 1/3] meta: Fix do_copy_boot_files error for different distros of same machine Anton Mikanovich
@ 2026-06-09 8:44 ` Anton Mikanovich
2026-06-29 16:04 ` 'MOESSBAUER, Felix' via isar-users
2026-06-09 8:44 ` [PATCH v11 3/3] CI: Check kernel artifacts deployment Anton Mikanovich
2026-06-29 15:21 ` [PATCH v11 0/3] Move kernel artifacts deployment from image recipe Zhihang Wei
3 siblings, 1 reply; 11+ messages in thread
From: Anton Mikanovich @ 2026-06-09 8:44 UTC (permalink / raw)
To: isar-users; +Cc: Anton Mikanovich
Task do_copy_boot_files deploys DTB files into the same location for
different images (e.g., isar-image-base and isar-image-ci). This causes
a build error.
do_copy_boot_files is called once for every image recipe while dtb
files belong to the kernel which is the same for both images. Performing
dtb deployment once for the same kernel solves the issue.
Introduce universal `kernel-deploy` bbclass responsible for extracting
the DTBs and kernel from the linux-image package and deploying them.
For the distro kernel type its package is now installed into sbuild
chroot. After that, deb which contains vmlinu[xz] file is extracted
from the apt cache.
Fixes test_dtb_deploy_images testcase:
ERROR: mc:phyboard-mira-bookworm:isar-image-base-1.0-r0 do_copy_boot_files: The recipe isar-image-base is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
build/tmp/deploy/images/phyboard-mira/imx6q-phytec-mira-rdk-nand.dtb
(not matched to any task)
Please verify which recipe should provide the above files.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
RECIPE-API-CHANGELOG.md | 13 ++++++
meta/classes-recipe/image.bbclass | 39 +++++++++--------
meta/classes-recipe/linux-deploy.bbclass | 46 ++++++++++++++++++++
meta/classes-recipe/linux-kernel.bbclass | 3 ++
meta/recipes-kernel/linux/files/getkernel.sh | 40 +++++++++++++++++
meta/recipes-kernel/linux/files/rules.tmpl | 12 +++++
meta/recipes-kernel/linux/linux-distro.bb | 27 ++++++++++++
testsuite/citest.py | 2 -
8 files changed, 161 insertions(+), 21 deletions(-)
create mode 100644 meta/classes-recipe/linux-deploy.bbclass
create mode 100755 meta/recipes-kernel/linux/files/getkernel.sh
create mode 100644 meta/recipes-kernel/linux/files/rules.tmpl
diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index a6ded089..ef9dce00 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -1102,3 +1102,16 @@ To prevent this new path is separated also by distro and kernel values.
This change will influence on build artifacts location and should be taken
into account by downstreams.
+
+### Move kernel and DTBs deployment from image recipe to kernel one
+
+To prevent parallel conflicting artifacts deployment from the same kernel
+used by different images, move original deployment logic from
+do_copy_boot_files() task of the image recipe to the kernel recipe. As we have
+two types of kernel (distro and self build), both are affected. With this
+aproach the deployment of any kernel artifacts will be performed only once per
+kernel.
+
+Also allow using different kernels for one machine and distro without
+overwritting by storing kernel artifacts in kernel-{KERNEL_NAME} subdirectory
+of DEPLOY_DIR_IMAGE. Previous image linking names are kept by symlinks.
diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass
index 26a4ec06..5f34cd4f 100644
--- a/meta/classes-recipe/image.bbclass
+++ b/meta/classes-recipe/image.bbclass
@@ -1,5 +1,7 @@
# This software is a part of Isar.
-# Copyright (C) 2015-2017 ilbers GmbH
+# Copyright (C) 2015-2026 ilbers GmbH
+#
+# SPDX-License-Identifier: MIT
# Make workdir and stamps machine-specific without changing common PN target
WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}/${PV}-${PR}"
@@ -9,7 +11,6 @@ STAMPCLEAN = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}/*-*"
# Sstate also needs to be machine-specific
SSTATE_MANIFESTS = "${TMPDIR}/sstate-control/${MACHINE}-${DISTRO}-${DISTRO_ARCH}"
-SSTATETASKS += "do_copy_boot_files"
IMAGE_INSTALL ?= ""
IMAGE_FSTYPES ?= "ext4"
@@ -381,37 +382,37 @@ INITRD_IMG = "${PP_DEPLOY}/${INITRD_DEPLOY_FILE}"
# only one dtb file supported, pick the first
DTB_IMG = "${PP_DEPLOY}/${@(d.getVar('DTB_FILES').split() or [''])[0]}"
-do_copy_boot_files[cleandirs] += "${DEPLOYDIR}"
-do_copy_boot_files[sstate-inputdirs] = "${DEPLOYDIR}"
-do_copy_boot_files[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
-do_copy_boot_files[network] = "${TASK_USE_SUDO}"
+KERNEL_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}/kernel-${KERNEL_NAME}"
+KERNEL_WILDCARD = "${@ 'vmlinu[xz]*' if (p := d.getVar('KERNEL_FILE')) == 'vmlinux' else p+'*'}"
+
+python() {
+ if d.getVar('KERNEL_NAME'):
+ pn = d.getVar('KERNEL_IMAGE_PKG') or ''
+ task = 'do_deploy_kernel_%s' % (d.getVar('MACHINE').replace('-','_') or '')
+ d.appendVarFlag("do_copy_boot_files", "depends", f"{pn}:{task}")
+}
+
+# Associate kernel with image by symlinks
+do_copy_boot_files[dirs] += "${DEPLOY_DIR_IMAGE}"
+do_copy_boot_files[file-checksums] += "${KERNEL_DEPLOY_DIR}/${KERNEL_WILDCARD}:True"
do_copy_boot_files() {
- kernel="$(realpath -q '${IMAGE_ROOTFS}'/vmlinu[xz])"
- if [ ! -f "$kernel" ]; then
- kernel="$(realpath -q '${IMAGE_ROOTFS}'/boot/vmlinu[xz])"
- fi
+ kernel="$(realpath -mq '${KERNEL_DEPLOY_DIR}/'${KERNEL_WILDCARD} | head -n1)"
if [ -f "$kernel" ]; then
- sudo cat "$kernel" > "${DEPLOYDIR}/${KERNEL_IMAGE}"
+ ln -sfr "$kernel" "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE}"
fi
for file in ${DTB_FILES}; do
- dtb="$(find '${IMAGE_ROOTFS}/usr/lib' -type f \
- -iwholename '*linux-image-*/'${file} | head -1)"
+ dtb="${KERNEL_DEPLOY_DIR}/$(basename ${file})"
if [ -z "$dtb" -o ! -e "$dtb" ]; then
die "${file} not found"
fi
- cp -f "$dtb" "${DEPLOYDIR}/"
+ ln -sfr "$dtb" "${DEPLOY_DIR_IMAGE}/$(basename $dtb)"
done
}
addtask copy_boot_files before do_rootfs_postprocess after do_rootfs_install
-python do_copy_boot_files_setscene () {
- sstate_setscene(d)
-}
-addtask do_copy_boot_files_setscene
-
python do_image_tools() {
"""Virtual task"""
pass
diff --git a/meta/classes-recipe/linux-deploy.bbclass b/meta/classes-recipe/linux-deploy.bbclass
new file mode 100644
index 00000000..cb29065d
--- /dev/null
+++ b/meta/classes-recipe/linux-deploy.bbclass
@@ -0,0 +1,46 @@
+# This software is a part of Isar.
+# Copyright (C) 2026 ilbers GmbH
+#
+# SPDX-License-Identifier: MIT
+
+DEPLOYDIR = "${WORKDIR}/deploy_${@ d.getVar('MACHINE').replace('-','_') or ''}"
+KERNEL_DEPLOY_TASKNAME ?= "do_deploy_kernel_${@ d.getVar('MACHINE').replace('-','_') or ''}"
+SSTATETASKS += "${KERNEL_DEPLOY_TASKNAME}"
+
+python () {
+ kernel_name = d.getVar('KERNEL_NAME_PROVIDED') or ''
+ if "linux-image-"+kernel_name in d.getVar('PROVIDES'):
+ task = d.getVar('KERNEL_DEPLOY_TASKNAME')
+ d.setVar(task, d.expand('kernel_deploy'))
+ d.setVarFlag(task, 'func', '1')
+ d.setVarFlag(task, 'sstate-inputdirs', d.expand('${DEPLOYDIR}'))
+ d.setVarFlag(task, 'sstate-outputdirs', d.expand('${KERNEL_DEPLOY_DIR}'))
+ d.appendVarFlag(task, 'cleandirs', d.expand('${DEPLOYDIR}'))
+ d.appendVarFlag(task, 'stamp-extra-info', d.expand('${MACHINE}'))
+ bb.build.addtask(task, 'do_build', 'do_dpkg_build', d)
+}
+
+KERNEL_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}/kernel-${KERNEL_NAME_PROVIDED}"
+
+KERNEL_LOCATION ?= "./boot"
+KERNEL_DEB ?= "linux-image-${KERNEL_NAME_PROVIDED}_${CHANGELOG_V}_${DISTRO_ARCH}.deb"
+
+# Take care the case when requested kernel format doesn't match distro one
+DEPLOY_WILDCARDS = "'${KERNEL_LOCATION}/${@ 'vmlinu[xz]*' if (p := d.getVar('KERNEL_FILE')) == 'vmlinux' else p+'*'}'"
+DEPLOY_WILDCARDS += "${@(' '.join("'*%s'" % p for p in (d.getVar('DTB_FILES') or '').split()))}"
+
+kernel_deploy() {
+ case "${PROVIDES}" in
+ *linux-image-${KERNEL_NAME_PROVIDED}*)
+ dpkg --fsys-tarfile ${WORKDIR}/${KERNEL_DEB} | \
+ tar xvf - -C "${DEPLOYDIR}" \
+ --transform='s|^.*/||' \
+ --wildcards ${DEPLOY_WILDCARDS}
+ ;;
+ esac
+}
+
+python do_copy_boot_files_setscene () {
+ sstate_setscene(d)
+}
+addtask do_copy_boot_files_setscene
diff --git a/meta/classes-recipe/linux-kernel.bbclass b/meta/classes-recipe/linux-kernel.bbclass
index e4ae356d..32d10f68 100644
--- a/meta/classes-recipe/linux-kernel.bbclass
+++ b/meta/classes-recipe/linux-kernel.bbclass
@@ -3,6 +3,7 @@
# This software is a part of Isar.
# Copyright (c) Siemens AG, 2022
# Copyright (c) Mentor Graphics, a Siemens business, 2022
+# Copyright (C) 2022-2026 ilbers GmbH
#
# SPDX-License-Identifier: MIT
@@ -337,3 +338,5 @@ do_dpkg_source:prepend() {
dpkg_configure_kernel
get_localversion_auto
}
+
+inherit linux-deploy
diff --git a/meta/recipes-kernel/linux/files/getkernel.sh b/meta/recipes-kernel/linux/files/getkernel.sh
new file mode 100755
index 00000000..7070dbc0
--- /dev/null
+++ b/meta/recipes-kernel/linux/files/getkernel.sh
@@ -0,0 +1,40 @@
+#!/bin/bash -e
+
+deb_cache="/var/cache/apt/archives"
+
+paths="/vmlinu[xz] /boot/vmlinu[xz]"
+if [ -n "$1" ]; then
+ paths="/$1 /boot/$1 $paths"
+fi
+
+# Lookup for the kernel file
+for path in ${paths}; do
+ kernel="$(realpath -q ${path})"
+ if [ -f "${kernel}" ]; then
+ break
+ fi
+done
+
+# Obtain package name for the kernel file
+pkg="$(dpkg -S ${kernel} | cut -d':' -f1)"
+if [ -z "${pkg}" ]; then
+ >&2 echo "No package providing ${kernel} found!"
+ exit 1
+fi
+
+# Query for deb filename
+deb_name=$(dpkg-query -W -f='${Package}_${Version}_${Architecture}.deb\n' ${pkg})
+
+# Take care about special symbols
+deb_name="${deb_name//%/%25}"
+deb_name="${deb_name//:/%3a}"
+deb_name="${deb_name//~/%7e}"
+
+# Search for deb in cache dir
+deb_path="$(find ${deb_cache} -name "${deb_name}" 2>/dev/null | head -n1)"
+if [ ! -f "${deb_path}" ]; then
+ >&2 echo "Package ${deb_name} not found in ${deb_cache}!"
+ exit 1
+fi
+
+echo "${deb_path}"
diff --git a/meta/recipes-kernel/linux/files/rules.tmpl b/meta/recipes-kernel/linux/files/rules.tmpl
new file mode 100644
index 00000000..69d79bb5
--- /dev/null
+++ b/meta/recipes-kernel/linux/files/rules.tmpl
@@ -0,0 +1,12 @@
+#!/usr/bin/make -f
+
+KERNEL_PATH := $(shell ./debian/getkernel.sh ${KERNEL_FILE})
+DEB_NAME := ${KERNEL_DEB}
+
+binary:
+ @[ -z "$(KERNEL_PATH)" ] && { echo "Kernel not found!"; exit 1; } || true
+ cp "$(KERNEL_PATH)" ../$(DEB_NAME)
+ echo "$(DEB_NAME) misc optional" > debian/files
+
+%:
+ true
diff --git a/meta/recipes-kernel/linux/linux-distro.bb b/meta/recipes-kernel/linux/linux-distro.bb
index 8fc1bcb7..47fe3fb4 100644
--- a/meta/recipes-kernel/linux/linux-distro.bb
+++ b/meta/recipes-kernel/linux/linux-distro.bb
@@ -2,6 +2,7 @@
#
# This software is a part of Isar.
# Copyright (c) Siemens AG, 2018
+# Copyright (C) 2022-2026 ilbers GmbH
#
# SPDX-License-Identifier: MIT
@@ -27,3 +28,29 @@ python() {
}
inherit multiarch
+inherit dpkg
+inherit linux-deploy
+
+# Always use target arch for kernel package lookup
+ISAR_CROSS_COMPILE = "0"
+
+MAINTAINER = "isar-users <isar-users@googlegroups.com>"
+
+PN .= "-${KERNEL_NAME}"
+KERNEL_NAME_PROVIDED ??= "${KERNEL_NAME}"
+DEBIAN_BUILD_DEPENDS ?= "${@d.getVar('KERNEL_IMAGE_PKG') or ('linux-image-' + (d.getVar('KERNEL_NAME') or ''))}"
+
+FILESPATH:prepend = "${LAYERDIR_core}/recipes-kernel/linux/files:"
+
+SRC_URI = "file://getkernel.sh \
+ file://rules.tmpl"
+
+TEMPLATE_VARS += "KERNEL_FILE KERNEL_DEB"
+TEMPLATE_FILES = "rules.tmpl"
+
+do_prepare_build[cleandirs] += "${S}/debian"
+do_prepare_build() {
+ deb_debianize
+ cp "${WORKDIR}/getkernel.sh" "${S}/debian/"
+}
+do_deploy_deb[noexec] = "1"
diff --git a/testsuite/citest.py b/testsuite/citest.py
index 7d666880..5aa3e799 100644
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -740,8 +740,6 @@ class DtbDeployTest(CIBaseTest):
self.init()
try:
self.perform_build_test(targets, image_install='')
- except exceptions.TestFail:
- self.cancel('KFAIL')
finally:
self.move_in_build_dir('tmp', 'tmp_dtbdeploy')
--
2.34.1
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260609084422.3948645-3-amikan%40ilbers.de.
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v11 2/3] meta: Move kernel artifacts deployment from image recipe
2026-06-09 8:44 ` [PATCH v11 2/3] meta: Move kernel artifacts deployment from image recipe Anton Mikanovich
@ 2026-06-29 16:04 ` 'MOESSBAUER, Felix' via isar-users
2026-06-30 12:21 ` Anton Mikanovich
0 siblings, 1 reply; 11+ messages in thread
From: 'MOESSBAUER, Felix' via isar-users @ 2026-06-29 16:04 UTC (permalink / raw)
To: amikan, isar-users
On Tue, 2026-06-09 at 11:44 +0300, Anton Mikanovich wrote:
> Task do_copy_boot_files deploys DTB files into the same location for
> different images (e.g., isar-image-base and isar-image-ci). This causes
> a build error.
>
> do_copy_boot_files is called once for every image recipe while dtb
> files belong to the kernel which is the same for both images. Performing
> dtb deployment once for the same kernel solves the issue.
>
> Introduce universal `kernel-deploy` bbclass responsible for extracting
> the DTBs and kernel from the linux-image package and deploying them.
>
> For the distro kernel type its package is now installed into sbuild
> chroot. After that, deb which contains vmlinu[xz] file is extracted
> from the apt cache.
>
> Fixes test_dtb_deploy_images testcase:
>
> ERROR: mc:phyboard-mira-bookworm:isar-image-base-1.0-r0 do_copy_boot_files: The recipe isar-image-base is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
> build/tmp/deploy/images/phyboard-mira/imx6q-phytec-mira-rdk-nand.dtb
> (not matched to any task)
> Please verify which recipe should provide the above files.
>
> Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
> ---
> RECIPE-API-CHANGELOG.md | 13 ++++++
> meta/classes-recipe/image.bbclass | 39 +++++++++--------
> meta/classes-recipe/linux-deploy.bbclass | 46 ++++++++++++++++++++
> meta/classes-recipe/linux-kernel.bbclass | 3 ++
> meta/recipes-kernel/linux/files/getkernel.sh | 40 +++++++++++++++++
> meta/recipes-kernel/linux/files/rules.tmpl | 12 +++++
> meta/recipes-kernel/linux/linux-distro.bb | 27 ++++++++++++
> testsuite/citest.py | 2 -
> 8 files changed, 161 insertions(+), 21 deletions(-)
> create mode 100644 meta/classes-recipe/linux-deploy.bbclass
> create mode 100755 meta/recipes-kernel/linux/files/getkernel.sh
> create mode 100644 meta/recipes-kernel/linux/files/rules.tmpl
>
> diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> index a6ded089..ef9dce00 100644
> --- a/RECIPE-API-CHANGELOG.md
> +++ b/RECIPE-API-CHANGELOG.md
> @@ -1102,3 +1102,16 @@ To prevent this new path is separated also by distro and kernel values.
>
> This change will influence on build artifacts location and should be taken
> into account by downstreams.
> +
> +### Move kernel and DTBs deployment from image recipe to kernel one
> +
> +To prevent parallel conflicting artifacts deployment from the same kernel
> +used by different images, move original deployment logic from
> +do_copy_boot_files() task of the image recipe to the kernel recipe. As we have
> +two types of kernel (distro and self build), both are affected. With this
> +aproach the deployment of any kernel artifacts will be performed only once per
> +kernel.
> +
> +Also allow using different kernels for one machine and distro without
> +overwritting by storing kernel artifacts in kernel-{KERNEL_NAME} subdirectory
> +of DEPLOY_DIR_IMAGE. Previous image linking names are kept by symlinks.
> diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass
> index 26a4ec06..5f34cd4f 100644
> --- a/meta/classes-recipe/image.bbclass
> +++ b/meta/classes-recipe/image.bbclass
> @@ -1,5 +1,7 @@
> # This software is a part of Isar.
> -# Copyright (C) 2015-2017 ilbers GmbH
> +# Copyright (C) 2015-2026 ilbers GmbH
> +#
> +# SPDX-License-Identifier: MIT
>
> # Make workdir and stamps machine-specific without changing common PN target
> WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}/${PV}-${PR}"
> @@ -9,7 +11,6 @@ STAMPCLEAN = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}/*-*"
>
> # Sstate also needs to be machine-specific
> SSTATE_MANIFESTS = "${TMPDIR}/sstate-control/${MACHINE}-${DISTRO}-${DISTRO_ARCH}"
> -SSTATETASKS += "do_copy_boot_files"
>
> IMAGE_INSTALL ?= ""
> IMAGE_FSTYPES ?= "ext4"
> @@ -381,37 +382,37 @@ INITRD_IMG = "${PP_DEPLOY}/${INITRD_DEPLOY_FILE}"
> # only one dtb file supported, pick the first
> DTB_IMG = "${PP_DEPLOY}/${@(d.getVar('DTB_FILES').split() or [''])[0]}"
>
> -do_copy_boot_files[cleandirs] += "${DEPLOYDIR}"
> -do_copy_boot_files[sstate-inputdirs] = "${DEPLOYDIR}"
> -do_copy_boot_files[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
> -do_copy_boot_files[network] = "${TASK_USE_SUDO}"
> +KERNEL_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}/kernel-${KERNEL_NAME}"
> +KERNEL_WILDCARD = "${@ 'vmlinu[xz]*' if (p := d.getVar('KERNEL_FILE')) == 'vmlinux' else p+'*'}"
> +
> +python() {
> + if d.getVar('KERNEL_NAME'):
> + pn = d.getVar('KERNEL_IMAGE_PKG') or ''
> + task = 'do_deploy_kernel_%s' % (d.getVar('MACHINE').replace('-','_') or '')
> + d.appendVarFlag("do_copy_boot_files", "depends", f"{pn}:{task}")
> +}
> +
> +# Associate kernel with image by symlinks
> +do_copy_boot_files[dirs] += "${DEPLOY_DIR_IMAGE}"
> +do_copy_boot_files[file-checksums] += "${KERNEL_DEPLOY_DIR}/${KERNEL_WILDCARD}:True"
> do_copy_boot_files() {
> - kernel="$(realpath -q '${IMAGE_ROOTFS}'/vmlinu[xz])"
> - if [ ! -f "$kernel" ]; then
> - kernel="$(realpath -q '${IMAGE_ROOTFS}'/boot/vmlinu[xz])"
> - fi
> + kernel="$(realpath -mq '${KERNEL_DEPLOY_DIR}/'${KERNEL_WILDCARD} | head -n1)"
> if [ -f "$kernel" ]; then
> - sudo cat "$kernel" > "${DEPLOYDIR}/${KERNEL_IMAGE}"
> + ln -sfr "$kernel" "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE}"
These symlinks will be dangling when running bitbake -c clean on the
kernel recipe. This is because the kernel is deployed via sstate cache,
but the symlink is manually created.
I have no idea how to fix this...
> fi
>
> for file in ${DTB_FILES}; do
> - dtb="$(find '${IMAGE_ROOTFS}/usr/lib' -type f \
> - -iwholename '*linux-image-*/'${file} | head -1)"
> + dtb="${KERNEL_DEPLOY_DIR}/$(basename ${file})"
>
> if [ -z "$dtb" -o ! -e "$dtb" ]; then
> die "${file} not found"
> fi
>
> - cp -f "$dtb" "${DEPLOYDIR}/"
> + ln -sfr "$dtb" "${DEPLOY_DIR_IMAGE}/$(basename $dtb)"
Same here.
> done
> }
> addtask copy_boot_files before do_rootfs_postprocess after do_rootfs_install
>
> -python do_copy_boot_files_setscene () {
> - sstate_setscene(d)
> -}
> -addtask do_copy_boot_files_setscene
> -
> python do_image_tools() {
> """Virtual task"""
> pass
> diff --git a/meta/classes-recipe/linux-deploy.bbclass b/meta/classes-recipe/linux-deploy.bbclass
> new file mode 100644
> index 00000000..cb29065d
> --- /dev/null
> +++ b/meta/classes-recipe/linux-deploy.bbclass
> @@ -0,0 +1,46 @@
> +# This software is a part of Isar.
> +# Copyright (C) 2026 ilbers GmbH
> +#
> +# SPDX-License-Identifier: MIT
> +
> +DEPLOYDIR = "${WORKDIR}/deploy_${@ d.getVar('MACHINE').replace('-','_') or ''}"
> +KERNEL_DEPLOY_TASKNAME ?= "do_deploy_kernel_${@ d.getVar('MACHINE').replace('-','_') or ''}"
> +SSTATETASKS += "${KERNEL_DEPLOY_TASKNAME}"
> +
> +python () {
> + kernel_name = d.getVar('KERNEL_NAME_PROVIDED') or ''
> + if "linux-image-"+kernel_name in d.getVar('PROVIDES'):
> + task = d.getVar('KERNEL_DEPLOY_TASKNAME')
> + d.setVar(task, d.expand('kernel_deploy'))
> + d.setVarFlag(task, 'func', '1')
> + d.setVarFlag(task, 'sstate-inputdirs', d.expand('${DEPLOYDIR}'))
> + d.setVarFlag(task, 'sstate-outputdirs', d.expand('${KERNEL_DEPLOY_DIR}'))
> + d.appendVarFlag(task, 'cleandirs', d.expand('${DEPLOYDIR}'))
> + d.appendVarFlag(task, 'stamp-extra-info', d.expand('${MACHINE}'))
Why not simply d.getVar()?
> + bb.build.addtask(task, 'do_build', 'do_dpkg_build', d)
> +}
> +
> +KERNEL_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}/kernel-${KERNEL_NAME_PROVIDED}"
> +
> +KERNEL_LOCATION ?= "./boot"
> +KERNEL_DEB ?= "linux-image-${KERNEL_NAME_PROVIDED}_${CHANGELOG_V}_${DISTRO_ARCH}.deb"
> +
> +# Take care the case when requested kernel format doesn't match distro one
> +DEPLOY_WILDCARDS = "'${KERNEL_LOCATION}/${@ 'vmlinu[xz]*' if (p := d.getVar('KERNEL_FILE')) == 'vmlinux' else p+'*'}'"
> +DEPLOY_WILDCARDS += "${@(' '.join("'*%s'" % p for p in (d.getVar('DTB_FILES') or '').split()))}"
> +
> +kernel_deploy() {
> + case "${PROVIDES}" in
> + *linux-image-${KERNEL_NAME_PROVIDED}*)
> + dpkg --fsys-tarfile ${WORKDIR}/${KERNEL_DEB} | \
> + tar xvf - -C "${DEPLOYDIR}" \
> + --transform='s|^.*/||' \
> + --wildcards ${DEPLOY_WILDCARDS}
> + ;;
> + esac
> +}
> +
> +python do_copy_boot_files_setscene () {
> + sstate_setscene(d)
> +}
> +addtask do_copy_boot_files_setscene
> diff --git a/meta/classes-recipe/linux-kernel.bbclass b/meta/classes-recipe/linux-kernel.bbclass
> index e4ae356d..32d10f68 100644
> --- a/meta/classes-recipe/linux-kernel.bbclass
> +++ b/meta/classes-recipe/linux-kernel.bbclass
> @@ -3,6 +3,7 @@
> # This software is a part of Isar.
> # Copyright (c) Siemens AG, 2022
> # Copyright (c) Mentor Graphics, a Siemens business, 2022
> +# Copyright (C) 2022-2026 ilbers GmbH
> #
> # SPDX-License-Identifier: MIT
>
> @@ -337,3 +338,5 @@ do_dpkg_source:prepend() {
> dpkg_configure_kernel
> get_localversion_auto
> }
> +
> +inherit linux-deploy
> diff --git a/meta/recipes-kernel/linux/files/getkernel.sh b/meta/recipes-kernel/linux/files/getkernel.sh
> new file mode 100755
> index 00000000..7070dbc0
> --- /dev/null
> +++ b/meta/recipes-kernel/linux/files/getkernel.sh
> @@ -0,0 +1,40 @@
> +#!/bin/bash -e
> +
> +deb_cache="/var/cache/apt/archives"
> +
> +paths="/vmlinu[xz] /boot/vmlinu[xz]"
> +if [ -n "$1" ]; then
> + paths="/$1 /boot/$1 $paths"
> +fi
> +
> +# Lookup for the kernel file
> +for path in ${paths}; do
> + kernel="$(realpath -q ${path})"
> + if [ -f "${kernel}" ]; then
> + break
> + fi
> +done
> +
> +# Obtain package name for the kernel file
> +pkg="$(dpkg -S ${kernel} | cut -d':' -f1)"
> +if [ -z "${pkg}" ]; then
> + >&2 echo "No package providing ${kernel} found!"
> + exit 1
> +fi
> +
> +# Query for deb filename
> +deb_name=$(dpkg-query -W -f='${Package}_${Version}_${Architecture}.deb\n' ${pkg})
> +
> +# Take care about special symbols
> +deb_name="${deb_name//%/%25}"
> +deb_name="${deb_name//:/%3a}"
> +deb_name="${deb_name//~/%7e}"
> +
> +# Search for deb in cache dir
> +deb_path="$(find ${deb_cache} -name "${deb_name}" 2>/dev/null | head -n1)"
> +if [ ! -f "${deb_path}" ]; then
> + >&2 echo "Package ${deb_name} not found in ${deb_cache}!"
> + exit 1
> +fi
> +
> +echo "${deb_path}"
> diff --git a/meta/recipes-kernel/linux/files/rules.tmpl b/meta/recipes-kernel/linux/files/rules.tmpl
> new file mode 100644
> index 00000000..69d79bb5
> --- /dev/null
> +++ b/meta/recipes-kernel/linux/files/rules.tmpl
> @@ -0,0 +1,12 @@
> +#!/usr/bin/make -f
> +
> +KERNEL_PATH := $(shell ./debian/getkernel.sh ${KERNEL_FILE})
> +DEB_NAME := ${KERNEL_DEB}
> +
> +binary:
> + @[ -z "$(KERNEL_PATH)" ] && { echo "Kernel not found!"; exit 1; } || true
> + cp "$(KERNEL_PATH)" ../$(DEB_NAME)
> + echo "$(DEB_NAME) misc optional" > debian/files
> +
> +%:
> + true
> diff --git a/meta/recipes-kernel/linux/linux-distro.bb b/meta/recipes-kernel/linux/linux-distro.bb
> index 8fc1bcb7..47fe3fb4 100644
> --- a/meta/recipes-kernel/linux/linux-distro.bb
> +++ b/meta/recipes-kernel/linux/linux-distro.bb
> @@ -2,6 +2,7 @@
> #
> # This software is a part of Isar.
> # Copyright (c) Siemens AG, 2018
> +# Copyright (C) 2022-2026 ilbers GmbH
> #
> # SPDX-License-Identifier: MIT
>
> @@ -27,3 +28,29 @@ python() {
> }
>
> inherit multiarch
> +inherit dpkg
> +inherit linux-deploy
> +
> +# Always use target arch for kernel package lookup
> +ISAR_CROSS_COMPILE = "0"
> +
> +MAINTAINER = "isar-users <isar-users@googlegroups.com>"
> +
> +PN .= "-${KERNEL_NAME}"
> +KERNEL_NAME_PROVIDED ??= "${KERNEL_NAME}"
> +DEBIAN_BUILD_DEPENDS ?= "${@d.getVar('KERNEL_IMAGE_PKG') or ('linux-image-' + (d.getVar('KERNEL_NAME') or ''))}"
> +
> +FILESPATH:prepend = "${LAYERDIR_core}/recipes-kernel/linux/files:"
> +
> +SRC_URI = "file://getkernel.sh \
> + file://rules.tmpl"
> +
> +TEMPLATE_VARS += "KERNEL_FILE KERNEL_DEB"
> +TEMPLATE_FILES = "rules.tmpl"
> +
> +do_prepare_build[cleandirs] += "${S}/debian"
> +do_prepare_build() {
> + deb_debianize
> + cp "${WORKDIR}/getkernel.sh" "${S}/debian/"
> +}
> +do_deploy_deb[noexec] = "1"
That is definitely a hack. I would prefer if linux-distro can avoid
inheriting dpkg, as this simply is not generating a package but just
registering dependencies / provides.
Felix
> diff --git a/testsuite/citest.py b/testsuite/citest.py
> index 7d666880..5aa3e799 100644
> --- a/testsuite/citest.py
> +++ b/testsuite/citest.py
> @@ -740,8 +740,6 @@ class DtbDeployTest(CIBaseTest):
> self.init()
> try:
> self.perform_build_test(targets, image_install='')
> - except exceptions.TestFail:
> - self.cancel('KFAIL')
> finally:
> self.move_in_build_dir('tmp', 'tmp_dtbdeploy')
>
> --
> 2.34.1
>
> --
> You received this message because you are subscribed to the Google Groups "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260609084422.3948645-3-amikan%40ilbers.de.
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/1402cd5ce266312076b38a6896873abd9615efd7.camel%40siemens.com.
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v11 2/3] meta: Move kernel artifacts deployment from image recipe
2026-06-29 16:04 ` 'MOESSBAUER, Felix' via isar-users
@ 2026-06-30 12:21 ` Anton Mikanovich
2026-06-30 14:28 ` 'MOESSBAUER, Felix' via isar-users
0 siblings, 1 reply; 11+ messages in thread
From: Anton Mikanovich @ 2026-06-30 12:21 UTC (permalink / raw)
To: MOESSBAUER, Felix, isar-users
Hello Felix, thanks for the review.
On 29/06/2026 18:04, MOESSBAUER, Felix wrote:
> On Tue, 2026-06-09 at 11:44 +0300, Anton Mikanovich wrote:
>> ...shortened...
>> +}
>> +
>> +# Associate kernel with image by symlinks
>> +do_copy_boot_files[dirs] += "${DEPLOY_DIR_IMAGE}"
>> +do_copy_boot_files[file-checksums] += "${KERNEL_DEPLOY_DIR}/${KERNEL_WILDCARD}:True"
>> do_copy_boot_files() {
>> - kernel="$(realpath -q '${IMAGE_ROOTFS}'/vmlinu[xz])"
>> - if [ ! -f "$kernel" ]; then
>> - kernel="$(realpath -q '${IMAGE_ROOTFS}'/boot/vmlinu[xz])"
>> - fi
>> + kernel="$(realpath -mq '${KERNEL_DEPLOY_DIR}/'${KERNEL_WILDCARD} | head -n1)"
>> if [ -f "$kernel" ]; then
>> - sudo cat "$kernel" > "${DEPLOYDIR}/${KERNEL_IMAGE}"
>> + ln -sfr "$kernel" "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE}"
> These symlinks will be dangling when running bitbake -c clean on the
> kernel recipe. This is because the kernel is deployed via sstate cache,
> but the symlink is manually created.
>
> I have no idea how to fix this...
It looks like this is not possible because kernel have no idea which
image it
was build for, and it can be shared between images.
I don't think this is a big issue because files will not be there after
clean
in any case. The only issue can be if some downstream rely only on the file
existence without care about possible symlinking, which is more downstream
logic issue.
Anyway those symlinks are left only for the backward compatibility and I
hope
downstreams will migrate to the new location (and naming) at some point.
I can try to make a hack to lookup for symlinks to kernel files in
deploy dir
inside of kernel's sstate tasks, but do we really need it?
>
>> fi
>>
>> for file in ${DTB_FILES}; do
>> - dtb="$(find '${IMAGE_ROOTFS}/usr/lib' -type f \
>> - -iwholename '*linux-image-*/'${file} | head -1)"
>> + dtb="${KERNEL_DEPLOY_DIR}/$(basename ${file})"
>>
>> if [ -z "$dtb" -o ! -e "$dtb" ]; then
>> die "${file} not found"
>> fi
>>
>> - cp -f "$dtb" "${DEPLOYDIR}/"
>> + ln -sfr "$dtb" "${DEPLOY_DIR_IMAGE}/$(basename $dtb)"
> Same here.
>
>> done
>> }
>> addtask copy_boot_files before do_rootfs_postprocess after do_rootfs_install
>>
>> -python do_copy_boot_files_setscene () {
>> - sstate_setscene(d)
>> -}
>> -addtask do_copy_boot_files_setscene
>> -
>> python do_image_tools() {
>> """Virtual task"""
>> pass
>> diff --git a/meta/classes-recipe/linux-deploy.bbclass b/meta/classes-recipe/linux-deploy.bbclass
>> new file mode 100644
>> index 00000000..cb29065d
>> --- /dev/null
>> +++ b/meta/classes-recipe/linux-deploy.bbclass
>> @@ -0,0 +1,46 @@
>> +# This software is a part of Isar.
>> +# Copyright (C) 2026 ilbers GmbH
>> +#
>> +# SPDX-License-Identifier: MIT
>> +
>> +DEPLOYDIR = "${WORKDIR}/deploy_${@ d.getVar('MACHINE').replace('-','_') or ''}"
>> +KERNEL_DEPLOY_TASKNAME ?= "do_deploy_kernel_${@ d.getVar('MACHINE').replace('-','_') or ''}"
>> +SSTATETASKS += "${KERNEL_DEPLOY_TASKNAME}"
>> +
>> +python () {
>> + kernel_name = d.getVar('KERNEL_NAME_PROVIDED') or ''
>> + if "linux-image-"+kernel_name in d.getVar('PROVIDES'):
>> + task = d.getVar('KERNEL_DEPLOY_TASKNAME')
>> + d.setVar(task, d.expand('kernel_deploy'))
>> + d.setVarFlag(task, 'func', '1')
>> + d.setVarFlag(task, 'sstate-inputdirs', d.expand('${DEPLOYDIR}'))
>> + d.setVarFlag(task, 'sstate-outputdirs', d.expand('${KERNEL_DEPLOY_DIR}'))
>> + d.appendVarFlag(task, 'cleandirs', d.expand('${DEPLOYDIR}'))
>> + d.appendVarFlag(task, 'stamp-extra-info', d.expand('${MACHINE}'))
> Why not simply d.getVar()?
It was implemented in the same style as imagetypes virtual tasks creation.
But maybe you are right and getVar (which is widely used across Isar) is
enough.
>
>> + bb.build.addtask(task, 'do_build', 'do_dpkg_build', d)
>> +}
>> +
>> +KERNEL_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}/kernel-${KERNEL_NAME_PROVIDED}"
>> +
>> +KERNEL_LOCATION ?= "./boot"
>> +KERNEL_DEB ?= "linux-image-${KERNEL_NAME_PROVIDED}_${CHANGELOG_V}_${DISTRO_ARCH}.deb"
>> +
>> +# Take care the case when requested kernel format doesn't match distro one
>> +DEPLOY_WILDCARDS = "'${KERNEL_LOCATION}/${@ 'vmlinu[xz]*' if (p := d.getVar('KERNEL_FILE')) == 'vmlinux' else p+'*'}'"
>> +DEPLOY_WILDCARDS += "${@(' '.join("'*%s'" % p for p in (d.getVar('DTB_FILES') or '').split()))}"
>> +
>> +kernel_deploy() {
>> + case "${PROVIDES}" in
>> + *linux-image-${KERNEL_NAME_PROVIDED}*)
>> + dpkg --fsys-tarfile ${WORKDIR}/${KERNEL_DEB} | \
>> + tar xvf - -C "${DEPLOYDIR}" \
>> + --transform='s|^.*/||' \
>> + --wildcards ${DEPLOY_WILDCARDS}
>> + ;;
>> + esac
>> +}
>> +
>> +python do_copy_boot_files_setscene () {
>> + sstate_setscene(d)
>> +}
>> +addtask do_copy_boot_files_setscene
>> diff --git a/meta/classes-recipe/linux-kernel.bbclass b/meta/classes-recipe/linux-kernel.bbclass
>> index e4ae356d..32d10f68 100644
>> --- a/meta/classes-recipe/linux-kernel.bbclass
>> +++ b/meta/classes-recipe/linux-kernel.bbclass
>> @@ -3,6 +3,7 @@
>> # This software is a part of Isar.
>> # Copyright (c) Siemens AG, 2022
>> # Copyright (c) Mentor Graphics, a Siemens business, 2022
>> +# Copyright (C) 2022-2026 ilbers GmbH
>> #
>> # SPDX-License-Identifier: MIT
>>
>> @@ -337,3 +338,5 @@ do_dpkg_source:prepend() {
>> dpkg_configure_kernel
>> get_localversion_auto
>> }
>> +
>> +inherit linux-deploy
>> diff --git a/meta/recipes-kernel/linux/files/getkernel.sh b/meta/recipes-kernel/linux/files/getkernel.sh
>> new file mode 100755
>> index 00000000..7070dbc0
>> --- /dev/null
>> +++ b/meta/recipes-kernel/linux/files/getkernel.sh
>> @@ -0,0 +1,40 @@
>> +#!/bin/bash -e
>> +
>> +deb_cache="/var/cache/apt/archives"
>> +
>> +paths="/vmlinu[xz] /boot/vmlinu[xz]"
>> +if [ -n "$1" ]; then
>> + paths="/$1 /boot/$1 $paths"
>> +fi
>> +
>> +# Lookup for the kernel file
>> +for path in ${paths}; do
>> + kernel="$(realpath -q ${path})"
>> + if [ -f "${kernel}" ]; then
>> + break
>> + fi
>> +done
>> +
>> +# Obtain package name for the kernel file
>> +pkg="$(dpkg -S ${kernel} | cut -d':' -f1)"
>> +if [ -z "${pkg}" ]; then
>> + >&2 echo "No package providing ${kernel} found!"
>> + exit 1
>> +fi
>> +
>> +# Query for deb filename
>> +deb_name=$(dpkg-query -W -f='${Package}_${Version}_${Architecture}.deb\n' ${pkg})
>> +
>> +# Take care about special symbols
>> +deb_name="${deb_name//%/%25}"
>> +deb_name="${deb_name//:/%3a}"
>> +deb_name="${deb_name//~/%7e}"
>> +
>> +# Search for deb in cache dir
>> +deb_path="$(find ${deb_cache} -name "${deb_name}" 2>/dev/null | head -n1)"
>> +if [ ! -f "${deb_path}" ]; then
>> + >&2 echo "Package ${deb_name} not found in ${deb_cache}!"
>> + exit 1
>> +fi
>> +
>> +echo "${deb_path}"
>> diff --git a/meta/recipes-kernel/linux/files/rules.tmpl b/meta/recipes-kernel/linux/files/rules.tmpl
>> new file mode 100644
>> index 00000000..69d79bb5
>> --- /dev/null
>> +++ b/meta/recipes-kernel/linux/files/rules.tmpl
>> @@ -0,0 +1,12 @@
>> +#!/usr/bin/make -f
>> +
>> +KERNEL_PATH := $(shell ./debian/getkernel.sh ${KERNEL_FILE})
>> +DEB_NAME := ${KERNEL_DEB}
>> +
>> +binary:
>> + @[ -z "$(KERNEL_PATH)" ] && { echo "Kernel not found!"; exit 1; } || true
>> + cp "$(KERNEL_PATH)" ../$(DEB_NAME)
>> + echo "$(DEB_NAME) misc optional" > debian/files
>> +
>> +%:
>> + true
>> diff --git a/meta/recipes-kernel/linux/linux-distro.bb b/meta/recipes-kernel/linux/linux-distro.bb
>> index 8fc1bcb7..47fe3fb4 100644
>> --- a/meta/recipes-kernel/linux/linux-distro.bb
>> +++ b/meta/recipes-kernel/linux/linux-distro.bb
>> @@ -2,6 +2,7 @@
>> #
>> # This software is a part of Isar.
>> # Copyright (c) Siemens AG, 2018
>> +# Copyright (C) 2022-2026 ilbers GmbH
>> #
>> # SPDX-License-Identifier: MIT
>>
>> @@ -27,3 +28,29 @@ python() {
>> }
>>
>> inherit multiarch
>> +inherit dpkg
>> +inherit linux-deploy
>> +
>> +# Always use target arch for kernel package lookup
>> +ISAR_CROSS_COMPILE = "0"
>> +
>> +MAINTAINER = "isar-users <isar-users@googlegroups.com>"
>> +
>> +PN .= "-${KERNEL_NAME}"
>> +KERNEL_NAME_PROVIDED ??= "${KERNEL_NAME}"
>> +DEBIAN_BUILD_DEPENDS ?= "${@d.getVar('KERNEL_IMAGE_PKG') or ('linux-image-' + (d.getVar('KERNEL_NAME') or ''))}"
>> +
>> +FILESPATH:prepend = "${LAYERDIR_core}/recipes-kernel/linux/files:"
>> +
>> +SRC_URI = "file://getkernel.sh \
>> + file://rules.tmpl"
>> +
>> +TEMPLATE_VARS += "KERNEL_FILE KERNEL_DEB"
>> +TEMPLATE_FILES = "rules.tmpl"
>> +
>> +do_prepare_build[cleandirs] += "${S}/debian"
>> +do_prepare_build() {
>> + deb_debianize
>> + cp "${WORKDIR}/getkernel.sh" "${S}/debian/"
>> +}
>> +do_deploy_deb[noexec] = "1"
> That is definitely a hack. I would prefer if linux-distro can avoid
> inheriting dpkg, as this simply is not generating a package but just
> registering dependencies / provides.
I was experimenting a lot with other implementations and it looks like
this is
the only way which works for all the cases. We need to install kernel
package
(which actually can be not just linux-image, but something linux-image
package
depends on, or even separate packages for kernel and dtbs) into some
rootfs to
be sure we are deploying exact output files.
I'm also don't like this approach but we don't have any other options.
>
> Felix
>
>> diff --git a/testsuite/citest.py b/testsuite/citest.py
>> index 7d666880..5aa3e799 100644
>> --- a/testsuite/citest.py
>> +++ b/testsuite/citest.py
>> @@ -740,8 +740,6 @@ class DtbDeployTest(CIBaseTest):
>> self.init()
>> try:
>> self.perform_build_test(targets, image_install='')
>> - except exceptions.TestFail:
>> - self.cancel('KFAIL')
>> finally:
>> self.move_in_build_dir('tmp', 'tmp_dtbdeploy')
>>
>> --
>> 2.34.1
>>
>> --
>> You received this message because you are subscribed to the Google Groups "isar-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
>> To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260609084422.3948645-3-amikan%40ilbers.de.
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/3a696f95-0f63-43c9-a9c4-c75bf34a30ee%40ilbers.de.
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v11 2/3] meta: Move kernel artifacts deployment from image recipe
2026-06-30 12:21 ` Anton Mikanovich
@ 2026-06-30 14:28 ` 'MOESSBAUER, Felix' via isar-users
0 siblings, 0 replies; 11+ messages in thread
From: 'MOESSBAUER, Felix' via isar-users @ 2026-06-30 14:28 UTC (permalink / raw)
To: amikan, isar-users
On Tue, 2026-06-30 at 15:21 +0300, Anton Mikanovich wrote:
> Hello Felix, thanks for the review.
>
> On 29/06/2026 18:04, MOESSBAUER, Felix wrote:
> > On Tue, 2026-06-09 at 11:44 +0300, Anton Mikanovich wrote:
> > > ...shortened...
> > > +}
> > > +
> > > +# Associate kernel with image by symlinks
> > > +do_copy_boot_files[dirs] += "${DEPLOY_DIR_IMAGE}"
> > > +do_copy_boot_files[file-checksums] += "${KERNEL_DEPLOY_DIR}/${KERNEL_WILDCARD}:True"
> > > do_copy_boot_files() {
> > > - kernel="$(realpath -q '${IMAGE_ROOTFS}'/vmlinu[xz])"
> > > - if [ ! -f "$kernel" ]; then
> > > - kernel="$(realpath -q '${IMAGE_ROOTFS}'/boot/vmlinu[xz])"
> > > - fi
> > > + kernel="$(realpath -mq '${KERNEL_DEPLOY_DIR}/'${KERNEL_WILDCARD} | head -n1)"
> > > if [ -f "$kernel" ]; then
> > > - sudo cat "$kernel" > "${DEPLOYDIR}/${KERNEL_IMAGE}"
> > > + ln -sfr "$kernel" "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE}"
> > These symlinks will be dangling when running bitbake -c clean on the
> > kernel recipe. This is because the kernel is deployed via sstate cache,
> > but the symlink is manually created.
> >
> > I have no idea how to fix this...
> It looks like this is not possible because kernel have no idea which
> image it
> was build for, and it can be shared between images.
>
> I don't think this is a big issue because files will not be there after
> clean
> in any case. The only issue can be if some downstream rely only on the file
> existence without care about possible symlinking, which is more downstream
> logic issue.
>
> Anyway those symlinks are left only for the backward compatibility and I
> hope
> downstreams will migrate to the new location (and naming) at some point.
Ack.
>
> I can try to make a hack to lookup for symlinks to kernel files in
> deploy dir
> inside of kernel's sstate tasks, but do we really need it?
Well, then let's better just accept this instead of adding another
workaround just for the cleanup.
> >
> > > fi
> > >
> > > for file in ${DTB_FILES}; do
> > > - dtb="$(find '${IMAGE_ROOTFS}/usr/lib' -type f \
> > > - -iwholename '*linux-image-*/'${file} | head -1)"
> > > + dtb="${KERNEL_DEPLOY_DIR}/$(basename ${file})"
> > >
> > > if [ -z "$dtb" -o ! -e "$dtb" ]; then
> > > die "${file} not found"
> > > fi
> > >
> > > - cp -f "$dtb" "${DEPLOYDIR}/"
> > > + ln -sfr "$dtb" "${DEPLOY_DIR_IMAGE}/$(basename $dtb)"
> > Same here.
> >
> > > done
> > > }
> > > addtask copy_boot_files before do_rootfs_postprocess after do_rootfs_install
> > >
> > > -python do_copy_boot_files_setscene () {
> > > - sstate_setscene(d)
> > > -}
> > > -addtask do_copy_boot_files_setscene
> > > -
> > > python do_image_tools() {
> > > """Virtual task"""
> > > pass
> > > diff --git a/meta/classes-recipe/linux-deploy.bbclass b/meta/classes-recipe/linux-deploy.bbclass
> > > new file mode 100644
> > > index 00000000..cb29065d
> > > --- /dev/null
> > > +++ b/meta/classes-recipe/linux-deploy.bbclass
> > > @@ -0,0 +1,46 @@
> > > +# This software is a part of Isar.
> > > +# Copyright (C) 2026 ilbers GmbH
> > > +#
> > > +# SPDX-License-Identifier: MIT
> > > +
> > > +DEPLOYDIR = "${WORKDIR}/deploy_${@ d.getVar('MACHINE').replace('-','_') or ''}"
> > > +KERNEL_DEPLOY_TASKNAME ?= "do_deploy_kernel_${@ d.getVar('MACHINE').replace('-','_') or ''}"
> > > +SSTATETASKS += "${KERNEL_DEPLOY_TASKNAME}"
> > > +
> > > +python () {
> > > + kernel_name = d.getVar('KERNEL_NAME_PROVIDED') or ''
> > > + if "linux-image-"+kernel_name in d.getVar('PROVIDES'):
> > > + task = d.getVar('KERNEL_DEPLOY_TASKNAME')
> > > + d.setVar(task, d.expand('kernel_deploy'))
> > > + d.setVarFlag(task, 'func', '1')
> > > + d.setVarFlag(task, 'sstate-inputdirs', d.expand('${DEPLOYDIR}'))
> > > + d.setVarFlag(task, 'sstate-outputdirs', d.expand('${KERNEL_DEPLOY_DIR}'))
> > > + d.appendVarFlag(task, 'cleandirs', d.expand('${DEPLOYDIR}'))
> > > + d.appendVarFlag(task, 'stamp-extra-info', d.expand('${MACHINE}'))
> > Why not simply d.getVar()?
> It was implemented in the same style as imagetypes virtual tasks creation.
> But maybe you are right and getVar (which is widely used across Isar) is
> enough.
It does not really matter. Just something I noticed.
> >
> > > + bb.build.addtask(task, 'do_build', 'do_dpkg_build', d)
> > > +}
> > > +
> > > +KERNEL_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}/kernel-${KERNEL_NAME_PROVIDED}"
> > > +
> > > +KERNEL_LOCATION ?= "./boot"
> > > +KERNEL_DEB ?= "linux-image-${KERNEL_NAME_PROVIDED}_${CHANGELOG_V}_${DISTRO_ARCH}.deb"
> > > +
> > > +# Take care the case when requested kernel format doesn't match distro one
> > > +DEPLOY_WILDCARDS = "'${KERNEL_LOCATION}/${@ 'vmlinu[xz]*' if (p := d.getVar('KERNEL_FILE')) == 'vmlinux' else p+'*'}'"
> > > +DEPLOY_WILDCARDS += "${@(' '.join("'*%s'" % p for p in (d.getVar('DTB_FILES') or '').split()))}"
> > > +
> > > +kernel_deploy() {
> > > + case "${PROVIDES}" in
> > > + *linux-image-${KERNEL_NAME_PROVIDED}*)
> > > + dpkg --fsys-tarfile ${WORKDIR}/${KERNEL_DEB} | \
> > > + tar xvf - -C "${DEPLOYDIR}" \
> > > + --transform='s|^.*/||' \
> > > + --wildcards ${DEPLOY_WILDCARDS}
> > > + ;;
> > > + esac
> > > +}
> > > +
> > > +python do_copy_boot_files_setscene () {
> > > + sstate_setscene(d)
> > > +}
> > > +addtask do_copy_boot_files_setscene
> > > diff --git a/meta/classes-recipe/linux-kernel.bbclass b/meta/classes-recipe/linux-kernel.bbclass
> > > index e4ae356d..32d10f68 100644
> > > --- a/meta/classes-recipe/linux-kernel.bbclass
> > > +++ b/meta/classes-recipe/linux-kernel.bbclass
> > > @@ -3,6 +3,7 @@
> > > # This software is a part of Isar.
> > > # Copyright (c) Siemens AG, 2022
> > > # Copyright (c) Mentor Graphics, a Siemens business, 2022
> > > +# Copyright (C) 2022-2026 ilbers GmbH
> > > #
> > > # SPDX-License-Identifier: MIT
> > >
> > > @@ -337,3 +338,5 @@ do_dpkg_source:prepend() {
> > > dpkg_configure_kernel
> > > get_localversion_auto
> > > }
> > > +
> > > +inherit linux-deploy
> > > diff --git a/meta/recipes-kernel/linux/files/getkernel.sh b/meta/recipes-kernel/linux/files/getkernel.sh
> > > new file mode 100755
> > > index 00000000..7070dbc0
> > > --- /dev/null
> > > +++ b/meta/recipes-kernel/linux/files/getkernel.sh
> > > @@ -0,0 +1,40 @@
> > > +#!/bin/bash -e
> > > +
> > > +deb_cache="/var/cache/apt/archives"
> > > +
> > > +paths="/vmlinu[xz] /boot/vmlinu[xz]"
> > > +if [ -n "$1" ]; then
> > > + paths="/$1 /boot/$1 $paths"
> > > +fi
> > > +
> > > +# Lookup for the kernel file
> > > +for path in ${paths}; do
> > > + kernel="$(realpath -q ${path})"
> > > + if [ -f "${kernel}" ]; then
> > > + break
> > > + fi
> > > +done
> > > +
> > > +# Obtain package name for the kernel file
> > > +pkg="$(dpkg -S ${kernel} | cut -d':' -f1)"
> > > +if [ -z "${pkg}" ]; then
> > > + >&2 echo "No package providing ${kernel} found!"
> > > + exit 1
> > > +fi
> > > +
> > > +# Query for deb filename
> > > +deb_name=$(dpkg-query -W -f='${Package}_${Version}_${Architecture}.deb\n' ${pkg})
> > > +
> > > +# Take care about special symbols
> > > +deb_name="${deb_name//%/%25}"
> > > +deb_name="${deb_name//:/%3a}"
> > > +deb_name="${deb_name//~/%7e}"
> > > +
> > > +# Search for deb in cache dir
> > > +deb_path="$(find ${deb_cache} -name "${deb_name}" 2>/dev/null | head -n1)"
> > > +if [ ! -f "${deb_path}" ]; then
> > > + >&2 echo "Package ${deb_name} not found in ${deb_cache}!"
> > > + exit 1
> > > +fi
> > > +
> > > +echo "${deb_path}"
> > > diff --git a/meta/recipes-kernel/linux/files/rules.tmpl b/meta/recipes-kernel/linux/files/rules.tmpl
> > > new file mode 100644
> > > index 00000000..69d79bb5
> > > --- /dev/null
> > > +++ b/meta/recipes-kernel/linux/files/rules.tmpl
> > > @@ -0,0 +1,12 @@
> > > +#!/usr/bin/make -f
> > > +
> > > +KERNEL_PATH := $(shell ./debian/getkernel.sh ${KERNEL_FILE})
> > > +DEB_NAME := ${KERNEL_DEB}
> > > +
> > > +binary:
> > > + @[ -z "$(KERNEL_PATH)" ] && { echo "Kernel not found!"; exit 1; } || true
> > > + cp "$(KERNEL_PATH)" ../$(DEB_NAME)
> > > + echo "$(DEB_NAME) misc optional" > debian/files
> > > +
> > > +%:
> > > + true
> > > diff --git a/meta/recipes-kernel/linux/linux-distro.bb b/meta/recipes-kernel/linux/linux-distro.bb
> > > index 8fc1bcb7..47fe3fb4 100644
> > > --- a/meta/recipes-kernel/linux/linux-distro.bb
> > > +++ b/meta/recipes-kernel/linux/linux-distro.bb
> > > @@ -2,6 +2,7 @@
> > > #
> > > # This software is a part of Isar.
> > > # Copyright (c) Siemens AG, 2018
> > > +# Copyright (C) 2022-2026 ilbers GmbH
> > > #
> > > # SPDX-License-Identifier: MIT
> > >
> > > @@ -27,3 +28,29 @@ python() {
> > > }
> > >
> > > inherit multiarch
> > > +inherit dpkg
> > > +inherit linux-deploy
> > > +
> > > +# Always use target arch for kernel package lookup
> > > +ISAR_CROSS_COMPILE = "0"
> > > +
> > > +MAINTAINER = "isar-users <isar-users@googlegroups.com>"
> > > +
> > > +PN .= "-${KERNEL_NAME}"
> > > +KERNEL_NAME_PROVIDED ??= "${KERNEL_NAME}"
> > > +DEBIAN_BUILD_DEPENDS ?= "${@d.getVar('KERNEL_IMAGE_PKG') or ('linux-image-' + (d.getVar('KERNEL_NAME') or ''))}"
> > > +
> > > +FILESPATH:prepend = "${LAYERDIR_core}/recipes-kernel/linux/files:"
> > > +
> > > +SRC_URI = "file://getkernel.sh \
> > > + file://rules.tmpl"
> > > +
> > > +TEMPLATE_VARS += "KERNEL_FILE KERNEL_DEB"
> > > +TEMPLATE_FILES = "rules.tmpl"
> > > +
> > > +do_prepare_build[cleandirs] += "${S}/debian"
> > > +do_prepare_build() {
> > > + deb_debianize
> > > + cp "${WORKDIR}/getkernel.sh" "${S}/debian/"
> > > +}
> > > +do_deploy_deb[noexec] = "1"
> > That is definitely a hack. I would prefer if linux-distro can avoid
> > inheriting dpkg, as this simply is not generating a package but just
> > registering dependencies / provides.
> I was experimenting a lot with other implementations and it looks like
> this is
> the only way which works for all the cases. We need to install kernel
> package
> (which actually can be not just linux-image, but something linux-image
> package
> depends on, or even separate packages for kernel and dtbs) into some
> rootfs to
> be sure we are deploying exact output files.
> I'm also don't like this approach but we don't have any other options.
Too bad... I also don't have a better approach, but still I'm a bit
concerned. Maybe there are opinions / ideas from others?
Felix
> >
> > Felix
> >
> > > diff --git a/testsuite/citest.py b/testsuite/citest.py
> > > index 7d666880..5aa3e799 100644
> > > --- a/testsuite/citest.py
> > > +++ b/testsuite/citest.py
> > > @@ -740,8 +740,6 @@ class DtbDeployTest(CIBaseTest):
> > > self.init()
> > > try:
> > > self.perform_build_test(targets, image_install='')
> > > - except exceptions.TestFail:
> > > - self.cancel('KFAIL')
> > > finally:
> > > self.move_in_build_dir('tmp', 'tmp_dtbdeploy')
> > >
> > > --
> > > 2.34.1
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "isar-users" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
> > > To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260609084422.3948645-3-amikan%40ilbers.de.
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/ef6a810419be5f39f2f3cc779154386d14daf9db.camel%40siemens.com.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v11 3/3] CI: Check kernel artifacts deployment
2026-06-09 8:44 [PATCH v11 0/3] Move kernel artifacts deployment from image recipe Anton Mikanovich
2026-06-09 8:44 ` [PATCH v11 1/3] meta: Fix do_copy_boot_files error for different distros of same machine Anton Mikanovich
2026-06-09 8:44 ` [PATCH v11 2/3] meta: Move kernel artifacts deployment from image recipe Anton Mikanovich
@ 2026-06-09 8:44 ` Anton Mikanovich
2026-06-29 16:06 ` 'MOESSBAUER, Felix' via isar-users
2026-06-29 15:21 ` [PATCH v11 0/3] Move kernel artifacts deployment from image recipe Zhihang Wei
3 siblings, 1 reply; 11+ messages in thread
From: Anton Mikanovich @ 2026-06-09 8:44 UTC (permalink / raw)
To: isar-users; +Cc: Anton Mikanovich
Improve existing deploy testcases to be sure kernel and dtb files are
really exist in deploy dir after the building.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
testsuite/citest.py | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/testsuite/citest.py b/testsuite/citest.py
index 5aa3e799..662af1de 100644
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -715,6 +715,20 @@ class DtbDeployTest(CIBaseTest):
:avocado: tags=dtbdeploy,full
"""
+ def check_kernel_deploy(self, targets):
+ for t in targets:
+ dd, kernel_name, dtbs = \
+ CIUtils.getVars('DEPLOY_DIR_IMAGE', 'KERNEL_IMAGE',
+ 'DTB_FILES', target=t)
+ self.log.info(f"dd={dd}, kernel_name={kernel_name}, dtbs={dtbs}")
+ kernel_path = f"{dd}/{kernel_name}"
+ if not os.path.exists(kernel_path):
+ self.fail(f"Target {t} failed to deploy kernel image!")
+ for dtb_name in dtbs.split():
+ dtb_path = f"{dd}/{dtb_name}"
+ if not os.path.exists(dtb_path):
+ self.fail(f"Target {t} failed to deploy {dtb_name}!")
+
def test_dtb_deploy_distros(self):
"""
Cover case: Same machine, different distros
@@ -727,6 +741,7 @@ class DtbDeployTest(CIBaseTest):
self.init()
self.move_in_build_dir('tmp', 'tmp_before_dtbdeploy')
self.perform_build_test(targets, image_install='')
+ self.check_kernel_deploy(targets)
def test_dtb_deploy_images(self):
"""
@@ -740,6 +755,7 @@ class DtbDeployTest(CIBaseTest):
self.init()
try:
self.perform_build_test(targets, image_install='')
+ self.check_kernel_deploy(targets)
finally:
self.move_in_build_dir('tmp', 'tmp_dtbdeploy')
--
2.34.1
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260609084422.3948645-4-amikan%40ilbers.de.
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v11 3/3] CI: Check kernel artifacts deployment
2026-06-09 8:44 ` [PATCH v11 3/3] CI: Check kernel artifacts deployment Anton Mikanovich
@ 2026-06-29 16:06 ` 'MOESSBAUER, Felix' via isar-users
0 siblings, 0 replies; 11+ messages in thread
From: 'MOESSBAUER, Felix' via isar-users @ 2026-06-29 16:06 UTC (permalink / raw)
To: amikan, isar-users
On Tue, 2026-06-09 at 11:44 +0300, Anton Mikanovich wrote:
> Improve existing deploy testcases to be sure kernel and dtb files are
> really exist in deploy dir after the building.
"are really exist": typo
The code itself is fine.
Felix
>
> Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
> ---
> testsuite/citest.py | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/testsuite/citest.py b/testsuite/citest.py
> index 5aa3e799..662af1de 100644
> --- a/testsuite/citest.py
> +++ b/testsuite/citest.py
> @@ -715,6 +715,20 @@ class DtbDeployTest(CIBaseTest):
> :avocado: tags=dtbdeploy,full
> """
>
> + def check_kernel_deploy(self, targets):
> + for t in targets:
> + dd, kernel_name, dtbs = \
> + CIUtils.getVars('DEPLOY_DIR_IMAGE', 'KERNEL_IMAGE',
> + 'DTB_FILES', target=t)
> + self.log.info(f"dd={dd}, kernel_name={kernel_name}, dtbs={dtbs}")
> + kernel_path = f"{dd}/{kernel_name}"
> + if not os.path.exists(kernel_path):
> + self.fail(f"Target {t} failed to deploy kernel image!")
> + for dtb_name in dtbs.split():
> + dtb_path = f"{dd}/{dtb_name}"
> + if not os.path.exists(dtb_path):
> + self.fail(f"Target {t} failed to deploy {dtb_name}!")
> +
> def test_dtb_deploy_distros(self):
> """
> Cover case: Same machine, different distros
> @@ -727,6 +741,7 @@ class DtbDeployTest(CIBaseTest):
> self.init()
> self.move_in_build_dir('tmp', 'tmp_before_dtbdeploy')
> self.perform_build_test(targets, image_install='')
> + self.check_kernel_deploy(targets)
>
> def test_dtb_deploy_images(self):
> """
> @@ -740,6 +755,7 @@ class DtbDeployTest(CIBaseTest):
> self.init()
> try:
> self.perform_build_test(targets, image_install='')
> + self.check_kernel_deploy(targets)
> finally:
> self.move_in_build_dir('tmp', 'tmp_dtbdeploy')
>
> --
> 2.34.1
>
> --
> You received this message because you are subscribed to the Google Groups "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260609084422.3948645-4-amikan%40ilbers.de.
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/4a941ab7f3ea7c1c919163a3a12092649cc1ebfc.camel%40siemens.com.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v11 0/3] Move kernel artifacts deployment from image recipe
2026-06-09 8:44 [PATCH v11 0/3] Move kernel artifacts deployment from image recipe Anton Mikanovich
` (2 preceding siblings ...)
2026-06-09 8:44 ` [PATCH v11 3/3] CI: Check kernel artifacts deployment Anton Mikanovich
@ 2026-06-29 15:21 ` Zhihang Wei
2026-06-29 15:54 ` 'MOESSBAUER, Felix' via isar-users
3 siblings, 1 reply; 11+ messages in thread
From: Zhihang Wei @ 2026-06-29 15:21 UTC (permalink / raw)
To: isar-users, Jan Kiszka; +Cc: Anton Mikanovich
On 6/9/26 10:44, Anton Mikanovich wrote:
> Image task "do_copy_boot_files" is used to deploy kernel, initrd and
> devicetree binaries to deploy directory.
>
> When different images for the same target are built (e.g., "-base" and
> "-debug") in parallel, this causes issues with DTB deployment since
> they have no any image_name-specific stuff in the path, unlike kernel
> and initrd.
>
> Here we move DTB deployment to the kernel recipe (for both distro and
> custom kernel recipes), where DTBs and kernel image are extracted from
> the kernel package.
> For the distro kernels it means we install its deb into the schroot to
> obtain the real artifacts from the filesystem.
>
> To keep the same artifacts path as before "do_copy_boot_files" task is
> now searching for the artifacts and create per-image symlinks.
> In case any naming conflicts (like dtbs with the same name from
> different kernels) the latest built dtb will be pointing by the
> symlink, while both will be deployed to different subdirs without
> conflicting and stay untouched.
> This symlink creation is done in the same way as artifacts conficts are
> handled by Yocto.
>
> The case when different distros (e.g., bullseye/bookworm) are using the
> same name for DTB binaries is covered by the patch 2. It also covers
> the case when image uses different kernel suffix (e.g., "realtime"
> option for the kernel in some downstreams).
>
> Related topics on maillist:
>
> https://groups.google.com/g/isar-users/c/ht3YmKZcJlM
> https://groups.google.com/g/isar-users/c/4BRDM02xC40
> https://groups.google.com/g/isar-users/c/qAnjahjjfsw
> https://groups.google.com/g/isar-users/c/ZMD4XY4dKWQ
> https://groups.google.com/g/isar-users/c/PSGU_AcdPZ8
> https://groups.google.com/g/isar-users/c/Va0Ue-ISYeA
> https://groups.google.com/g/isar-users/c/ixzytHYnTmI
>
> Changes since v10:
> - Rebase on next.
> - Use the same deploy dir with per-kernel subdirs.
> - Allow using different kernels for one machine.
> - Restore paths for downstreams in Yocto way (symlinks).
>
> Changes since v9:
> - Base on v6.
> - Rebase on next.
> - Move also kernel deployment from image recipe.
>
> Changes since v8:
> - Rebase on next.
> - Document how this approach differs from OpenEmbedded.
>
> Changes since v7:
> - Fix SOB.
>
> Changes since v6:
> - Fix isoimage-isohybrid-isar WIC plugin.
> - Split testcases.
> - Update wording.
>
> Changes since v4:
> - Rebase on next.
> - Squash latest patch to first one.
> - Fix deploy paths in initrd tests.
>
> Changes since v3:
> - Rebase on next.
> - Fix target deploy dir path for installer.
>
> Changes since v2:
> - Patch 1: Consider also kernel suffix.
> - Patch 2: Use separate testcase for possible dtb clashes.
> - Minor cosmetic fixes.
>
> Changes since v1:
> - Separate `dtb-files` recipe used instead of linux one
> - Included older "[PATCH] Fix do_copy_boot_files error" into the
> series ( https://groups.google.com/g/isar-users/c/Va0Ue-ISYeA )
>
> Anton Mikanovich (3):
> meta: Fix do_copy_boot_files error for different distros of same
> machine
> meta: Move kernel artifacts deployment from image recipe
> CI: Check kernel artifacts deployment
>
> RECIPE-API-CHANGELOG.md | 28 +++++++++++
> .../installer-add-rootfs.bbclass | 2 +-
> meta/classes-recipe/image.bbclass | 39 ++++++++--------
> meta/classes-recipe/linux-deploy.bbclass | 46 +++++++++++++++++++
> meta/classes-recipe/linux-kernel.bbclass | 3 ++
> meta/conf/bitbake.conf | 2 +-
> meta/recipes-kernel/linux/files/getkernel.sh | 40 ++++++++++++++++
> meta/recipes-kernel/linux/files/rules.tmpl | 12 +++++
> meta/recipes-kernel/linux/linux-distro.bb | 27 +++++++++++
> testsuite/citest.py | 30 ++++++++----
> 10 files changed, 199 insertions(+), 30 deletions(-)
> create mode 100644 meta/classes-recipe/linux-deploy.bbclass
> create mode 100755 meta/recipes-kernel/linux/files/getkernel.sh
> create mode 100644 meta/recipes-kernel/linux/files/rules.tmpl
>
Hi all,
Any feedback or downstream testing results for this version? Thanks.
Zhihang
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/51b0dfa9-9de6-4b03-86fe-c0acad5780a1%40ilbers.de.
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v11 0/3] Move kernel artifacts deployment from image recipe
2026-06-29 15:21 ` [PATCH v11 0/3] Move kernel artifacts deployment from image recipe Zhihang Wei
@ 2026-06-29 15:54 ` 'MOESSBAUER, Felix' via isar-users
2026-06-30 12:21 ` Anton Mikanovich
0 siblings, 1 reply; 11+ messages in thread
From: 'MOESSBAUER, Felix' via isar-users @ 2026-06-29 15:54 UTC (permalink / raw)
To: Zhihang Wei, isar-users, Kiszka, Jan; +Cc: amikan
On Mon, 2026-06-29 at 17:21 +0200, Zhihang Wei wrote:
> On 6/9/26 10:44, Anton Mikanovich wrote:
> > Image task "do_copy_boot_files" is used to deploy kernel, initrd and
> > devicetree binaries to deploy directory.
Technically, only the kernel and device tree is deployed. The initrd is
deployed from the rootfs_generate_initramfs task (which currently
breaks reproducibility under sstate cache due to a bug I will fix once
rootless is merged).
I'll review the other patches as well now.
Felix
> >
> > When different images for the same target are built (e.g., "-base" and
> > "-debug") in parallel, this causes issues with DTB deployment since
> > they have no any image_name-specific stuff in the path, unlike kernel
> > and initrd.
> >
> > Here we move DTB deployment to the kernel recipe (for both distro and
> > custom kernel recipes), where DTBs and kernel image are extracted from
> > the kernel package.
> > For the distro kernels it means we install its deb into the schroot to
> > obtain the real artifacts from the filesystem.
> >
> > To keep the same artifacts path as before "do_copy_boot_files" task is
> > now searching for the artifacts and create per-image symlinks.
> > In case any naming conflicts (like dtbs with the same name from
> > different kernels) the latest built dtb will be pointing by the
> > symlink, while both will be deployed to different subdirs without
> > conflicting and stay untouched.
> > This symlink creation is done in the same way as artifacts conficts are
> > handled by Yocto.
> >
> > The case when different distros (e.g., bullseye/bookworm) are using the
> > same name for DTB binaries is covered by the patch 2. It also covers
> > the case when image uses different kernel suffix (e.g., "realtime"
> > option for the kernel in some downstreams).
> >
> > Related topics on maillist:
> >
> > https://groups.google.com/g/isar-users/c/ht3YmKZcJlM
> > https://groups.google.com/g/isar-users/c/4BRDM02xC40
> > https://groups.google.com/g/isar-users/c/qAnjahjjfsw
> > https://groups.google.com/g/isar-users/c/ZMD4XY4dKWQ
> > https://groups.google.com/g/isar-users/c/PSGU_AcdPZ8
> > https://groups.google.com/g/isar-users/c/Va0Ue-ISYeA
> > https://groups.google.com/g/isar-users/c/ixzytHYnTmI
> >
> > Changes since v10:
> > - Rebase on next.
> > - Use the same deploy dir with per-kernel subdirs.
> > - Allow using different kernels for one machine.
> > - Restore paths for downstreams in Yocto way (symlinks).
> >
> > Changes since v9:
> > - Base on v6.
> > - Rebase on next.
> > - Move also kernel deployment from image recipe.
> >
> > Changes since v8:
> > - Rebase on next.
> > - Document how this approach differs from OpenEmbedded.
> >
> > Changes since v7:
> > - Fix SOB.
> >
> > Changes since v6:
> > - Fix isoimage-isohybrid-isar WIC plugin.
> > - Split testcases.
> > - Update wording.
> >
> > Changes since v4:
> > - Rebase on next.
> > - Squash latest patch to first one.
> > - Fix deploy paths in initrd tests.
> >
> > Changes since v3:
> > - Rebase on next.
> > - Fix target deploy dir path for installer.
> >
> > Changes since v2:
> > - Patch 1: Consider also kernel suffix.
> > - Patch 2: Use separate testcase for possible dtb clashes.
> > - Minor cosmetic fixes.
> >
> > Changes since v1:
> > - Separate `dtb-files` recipe used instead of linux one
> > - Included older "[PATCH] Fix do_copy_boot_files error" into the
> > series ( https://groups.google.com/g/isar-users/c/Va0Ue-ISYeA )
> >
> > Anton Mikanovich (3):
> > meta: Fix do_copy_boot_files error for different distros of same
> > machine
> > meta: Move kernel artifacts deployment from image recipe
> > CI: Check kernel artifacts deployment
> >
> > RECIPE-API-CHANGELOG.md | 28 +++++++++++
> > .../installer-add-rootfs.bbclass | 2 +-
> > meta/classes-recipe/image.bbclass | 39 ++++++++--------
> > meta/classes-recipe/linux-deploy.bbclass | 46 +++++++++++++++++++
> > meta/classes-recipe/linux-kernel.bbclass | 3 ++
> > meta/conf/bitbake.conf | 2 +-
> > meta/recipes-kernel/linux/files/getkernel.sh | 40 ++++++++++++++++
> > meta/recipes-kernel/linux/files/rules.tmpl | 12 +++++
> > meta/recipes-kernel/linux/linux-distro.bb | 27 +++++++++++
> > testsuite/citest.py | 30 ++++++++----
> > 10 files changed, 199 insertions(+), 30 deletions(-)
> > create mode 100644 meta/classes-recipe/linux-deploy.bbclass
> > create mode 100755 meta/recipes-kernel/linux/files/getkernel.sh
> > create mode 100644 meta/recipes-kernel/linux/files/rules.tmpl
> >
> Hi all,
>
> Any feedback or downstream testing results for this version? Thanks.
>
> Zhihang
>
> --
> You received this message because you are subscribed to the Google Groups "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/isar-users/51b0dfa9-9de6-4b03-86fe-c0acad5780a1%40ilbers.de.
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/59dc65a158628c529c37f5f1c93337a7b33610e4.camel%40siemens.com.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v11 0/3] Move kernel artifacts deployment from image recipe
2026-06-29 15:54 ` 'MOESSBAUER, Felix' via isar-users
@ 2026-06-30 12:21 ` Anton Mikanovich
0 siblings, 0 replies; 11+ messages in thread
From: Anton Mikanovich @ 2026-06-30 12:21 UTC (permalink / raw)
To: MOESSBAUER, Felix, Zhihang Wei, isar-users, Kiszka, Jan
On 29/06/2026 17:54, MOESSBAUER, Felix wrote:
> On Mon, 2026-06-29 at 17:21 +0200, Zhihang Wei wrote:
>> On 6/9/26 10:44, Anton Mikanovich wrote:
>>> Image task "do_copy_boot_files" is used to deploy kernel, initrd and
>>> devicetree binaries to deploy directory.
> Technically, only the kernel and device tree is deployed. The initrd is
> deployed from the rootfs_generate_initramfs task (which currently
> breaks reproducibility under sstate cache due to a bug I will fix once
> rootless is merged).
This was left from previous patchset version before initramfs changes,
will fix.
>
> I'll review the other patches as well now.
>
> Felix
>
>>> When different images for the same target are built (e.g., "-base" and
>>> "-debug") in parallel, this causes issues with DTB deployment since
>>> they have no any image_name-specific stuff in the path, unlike kernel
>>> and initrd.
>>>
>>> Here we move DTB deployment to the kernel recipe (for both distro and
>>> custom kernel recipes), where DTBs and kernel image are extracted from
>>> the kernel package.
>>> For the distro kernels it means we install its deb into the schroot to
>>> obtain the real artifacts from the filesystem.
>>>
>>> To keep the same artifacts path as before "do_copy_boot_files" task is
>>> now searching for the artifacts and create per-image symlinks.
>>> In case any naming conflicts (like dtbs with the same name from
>>> different kernels) the latest built dtb will be pointing by the
>>> symlink, while both will be deployed to different subdirs without
>>> conflicting and stay untouched.
>>> This symlink creation is done in the same way as artifacts conficts are
>>> handled by Yocto.
>>>
>>> The case when different distros (e.g., bullseye/bookworm) are using the
>>> same name for DTB binaries is covered by the patch 2. It also covers
>>> the case when image uses different kernel suffix (e.g., "realtime"
>>> option for the kernel in some downstreams).
>>>
>>> Related topics on maillist:
>>>
>>> https://groups.google.com/g/isar-users/c/ht3YmKZcJlM
>>> https://groups.google.com/g/isar-users/c/4BRDM02xC40
>>> https://groups.google.com/g/isar-users/c/qAnjahjjfsw
>>> https://groups.google.com/g/isar-users/c/ZMD4XY4dKWQ
>>> https://groups.google.com/g/isar-users/c/PSGU_AcdPZ8
>>> https://groups.google.com/g/isar-users/c/Va0Ue-ISYeA
>>> https://groups.google.com/g/isar-users/c/ixzytHYnTmI
>>>
>>> Changes since v10:
>>> - Rebase on next.
>>> - Use the same deploy dir with per-kernel subdirs.
>>> - Allow using different kernels for one machine.
>>> - Restore paths for downstreams in Yocto way (symlinks).
>>>
>>> Changes since v9:
>>> - Base on v6.
>>> - Rebase on next.
>>> - Move also kernel deployment from image recipe.
>>>
>>> Changes since v8:
>>> - Rebase on next.
>>> - Document how this approach differs from OpenEmbedded.
>>>
>>> Changes since v7:
>>> - Fix SOB.
>>>
>>> Changes since v6:
>>> - Fix isoimage-isohybrid-isar WIC plugin.
>>> - Split testcases.
>>> - Update wording.
>>>
>>> Changes since v4:
>>> - Rebase on next.
>>> - Squash latest patch to first one.
>>> - Fix deploy paths in initrd tests.
>>>
>>> Changes since v3:
>>> - Rebase on next.
>>> - Fix target deploy dir path for installer.
>>>
>>> Changes since v2:
>>> - Patch 1: Consider also kernel suffix.
>>> - Patch 2: Use separate testcase for possible dtb clashes.
>>> - Minor cosmetic fixes.
>>>
>>> Changes since v1:
>>> - Separate `dtb-files` recipe used instead of linux one
>>> - Included older "[PATCH] Fix do_copy_boot_files error" into the
>>> series ( https://groups.google.com/g/isar-users/c/Va0Ue-ISYeA )
>>>
>>> Anton Mikanovich (3):
>>> meta: Fix do_copy_boot_files error for different distros of same
>>> machine
>>> meta: Move kernel artifacts deployment from image recipe
>>> CI: Check kernel artifacts deployment
>>>
>>> RECIPE-API-CHANGELOG.md | 28 +++++++++++
>>> .../installer-add-rootfs.bbclass | 2 +-
>>> meta/classes-recipe/image.bbclass | 39 ++++++++--------
>>> meta/classes-recipe/linux-deploy.bbclass | 46 +++++++++++++++++++
>>> meta/classes-recipe/linux-kernel.bbclass | 3 ++
>>> meta/conf/bitbake.conf | 2 +-
>>> meta/recipes-kernel/linux/files/getkernel.sh | 40 ++++++++++++++++
>>> meta/recipes-kernel/linux/files/rules.tmpl | 12 +++++
>>> meta/recipes-kernel/linux/linux-distro.bb | 27 +++++++++++
>>> testsuite/citest.py | 30 ++++++++----
>>> 10 files changed, 199 insertions(+), 30 deletions(-)
>>> create mode 100644 meta/classes-recipe/linux-deploy.bbclass
>>> create mode 100755 meta/recipes-kernel/linux/files/getkernel.sh
>>> create mode 100644 meta/recipes-kernel/linux/files/rules.tmpl
>>>
>> Hi all,
>>
>> Any feedback or downstream testing results for this version? Thanks.
>>
>> Zhihang
>>
>> --
>> You received this message because you are subscribed to the Google Groups "isar-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
>> To view this discussion visit https://groups.google.com/d/msgid/isar-users/51b0dfa9-9de6-4b03-86fe-c0acad5780a1%40ilbers.de.
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/54edfa40-d4ab-4587-8e76-c6ba3fa906a9%40ilbers.de.
^ permalink raw reply [flat|nested] 11+ messages in thread