From: "'MOESSBAUER, Felix' via isar-users" <isar-users@googlegroups.com>
To: "amikan@ilbers.de" <amikan@ilbers.de>,
"isar-users@googlegroups.com" <isar-users@googlegroups.com>
Subject: Re: [PATCH v12 2/3] meta: Move kernel artifacts deployment from image recipe
Date: Tue, 7 Jul 2026 09:06:39 +0000 [thread overview]
Message-ID: <ac2f7d165688d3fc8c20cadbdfb0160e1763ed2a.camel@siemens.com> (raw)
In-Reply-To: <20260703150835.2490688-3-amikan@ilbers.de>
On Fri, 2026-07-03 at 18:08 +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
>
[snip]
> diff --git a/meta/classes-recipe/linux-deploy.bbclass b/meta/classes-recipe/linux-deploy.bbclass
> new file mode 100644
> index 00000000..4b33e234
> --- /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 ''}"
Changing the deploy dir is dangerous, as this also affects other tasks
of the dpkg class. If more than one task of a class performs a sstate
operation, the deploy dirs should also be split.
While this currently is not a problem, it will be once we cleanup the
deployment of the dpkg files. I have a patch for that, which is
currently queued behind the rootless series, but it will send it here
for reference as well.
Felix
> +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.getVar('DEPLOYDIR'))
> + d.setVarFlag(task, 'sstate-outputdirs', d.getVar('KERNEL_DEPLOY_DIR'))
> + d.appendVarFlag(task, 'cleandirs', d.getVar('DEPLOYDIR'))
> + d.appendVarFlag(task, 'stamp-extra-info', d.getVar('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
>
--
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/ac2f7d165688d3fc8c20cadbdfb0160e1763ed2a.camel%40siemens.com.
next prev parent reply other threads:[~2026-07-07 9:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-03 15:08 [PATCH v12 0/3] " Anton Mikanovich
2026-07-03 15:08 ` [PATCH v12 1/3] meta: Fix do_copy_boot_files error for different distros of same machine Anton Mikanovich
2026-07-03 15:08 ` [PATCH v12 2/3] meta: Move kernel artifacts deployment from image recipe Anton Mikanovich
2026-07-07 9:06 ` 'MOESSBAUER, Felix' via isar-users [this message]
2026-07-07 9:09 ` [PATCH 1/1] dpkg: directly deploy via sstate cache 'Felix Moessbauer' via isar-users
2026-07-03 15:08 ` [PATCH v12 3/3] CI: Check kernel artifacts deployment Anton Mikanovich
2026-07-07 9:52 ` [PATCH v12 0/3] Move kernel artifacts deployment from image recipe 'Quirin Gylstorff' via isar-users
2026-07-07 11:11 ` 'Jan Kiszka' via isar-users
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ac2f7d165688d3fc8c20cadbdfb0160e1763ed2a.camel@siemens.com \
--to=isar-users@googlegroups.com \
--cc=amikan@ilbers.de \
--cc=felix.moessbauer@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox