From: "'Felix Moessbauer' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: christoph.steiger@siemens.com,
Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH 6/6] sbom: cache artifact in sstate cache
Date: Mon, 20 Jul 2026 10:13:47 +0200 [thread overview]
Message-ID: <20260720081347.3835974-7-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20260720081347.3835974-1-felix.moessbauer@siemens.com>
By that, repeated builds of unchanged rootfs do not need to run through
the potentially expensive SBOM generation.
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
meta/classes/sbom.bbclass | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/meta/classes/sbom.bbclass b/meta/classes/sbom.bbclass
index 4f7f2251..b2e8aff6 100644
--- a/meta/classes/sbom.bbclass
+++ b/meta/classes/sbom.bbclass
@@ -21,6 +21,7 @@ SBOM_DEBSBOM_EXTRA_ARGS ?= "--with-licenses"
SBOM_SPDX_NAMESPACE_PREFIX ?= "https://spdx.org/spdxdocs"
DEPLOY_DIR_SBOM = "${DEPLOY_DIR_IMAGE}"
+SBOM_LOCAL_DEPLOYDIR = "${WORKDIR}/chroot-sbom-deploy"
SBOM_DIR = "${DEPLOY_DIR}/chroot-sbom"
SBOM_CHROOT = "${SBOM_DIR}/${HOST_DISTRO}-${HOST_ARCH}_${DISTRO}-${DISTRO_ARCH}.tar.zst"
@@ -62,7 +63,7 @@ EOF
--unshare-user \
--unshare-pid \
--bind ${SBOM_CHROOT_LOCAL} / \
- --bind ${DEPLOY_DIR_SBOM} /mnt/deploy-dir \
+ --bind ${SBOM_LOCAL_DEPLOYDIR} /mnt/deploy-dir \
-- debsbom -v generate ${SBOM_DEBSBOM_TYPE_ARGS} -r /mnt/rootfs -o /mnt/deploy-dir/'${ROOTFS_PACKAGE_SUFFIX}' \
--distro-name '${SBOM_DISTRO_NAME}' --distro-supplier '${SBOM_DISTRO_SUPPLIER}' \
--distro-version '${SBOM_DISTRO_VERSION}' --distro-arch '${DISTRO_ARCH}' \
@@ -76,7 +77,10 @@ cleanup_sbom_chroot() {
run_privileged rm -rf ${SBOM_CHROOT_LOCAL}
}
-do_generate_sbom[dirs] += "${DEPLOY_DIR_SBOM}"
+SSTATETASKS += "do_generate_sbom"
+do_generate_sbom[cleandirs] += "${SBOM_LOCAL_DEPLOYDIR}"
+do_generate_sbom[sstate-inputdirs] = "${SBOM_LOCAL_DEPLOYDIR}"
+do_generate_sbom[sstate-outputdirs] = "${DEPLOY_DIR_SBOM}"
do_generate_sbom[network] = "${TASK_USE_SUDO}"
do_generate_sbom[depends] += "sbom-chroot:do_sbomchroot_deploy"
python do_generate_sbom() {
@@ -88,9 +92,14 @@ python do_generate_sbom() {
bb.build.exec_func("cleanup_sbom_chroot", d)
}
+python do_generate_sbom_setscene() {
+ sstate_setscene(d)
+}
+
# The sbom generator uses the apt state captured during do_rootfs_install,
# so it can run as a standalone task afterwards
python() {
if 'generate-sbom' in d.getVar('ROOTFS_FEATURES').split():
bb.build.addtask('do_generate_sbom', 'do_rootfs', 'do_rootfs_install', d)
+ bb.build.addtask('do_generate_sbom_setscene', None, None, d)
}
--
2.53.0
--
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/20260720081347.3835974-7-felix.moessbauer%40siemens.com.
next prev parent reply other threads:[~2026-07-20 8:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 8:13 [PATCH 0/6] Rework SBOM generation 'Felix Moessbauer' via isar-users
2026-07-20 8:13 ` [PATCH 1/6] rootfs: capture apt-state before rootfs cleanup 'Felix Moessbauer' via isar-users
2026-07-20 8:13 ` [PATCH 2/6] sbom: run generator as task with apt-cache as input 'Felix Moessbauer' via isar-users
2026-07-20 8:13 ` [PATCH 3/6] wic: make dependency to sbom chroot explicit 'Felix Moessbauer' via isar-users
2026-07-20 8:13 ` [PATCH 4/6] sbom: deploy sbom chroot to distro specific file 'Felix Moessbauer' via isar-users
2026-07-20 8:13 ` [PATCH 5/6] sbom: align deploy dir names 'Felix Moessbauer' via isar-users
2026-07-20 8:13 ` 'Felix Moessbauer' via isar-users [this message]
2026-07-28 15:28 ` [PATCH 0/6] Rework SBOM generation Zhihang Wei
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=20260720081347.3835974-7-felix.moessbauer@siemens.com \
--to=isar-users@googlegroups.com \
--cc=christoph.steiger@siemens.com \
--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