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 2/6] sbom: run generator as task with apt-cache as input
Date: Mon, 20 Jul 2026 10:13:43 +0200 [thread overview]
Message-ID: <20260720081347.3835974-3-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20260720081347.3835974-1-felix.moessbauer@siemens.com>
As the rootfs now deploys the apt cache prior to any modification, we
can safely run the sbom generator as a standalone task. By that, we get
more parallelism into the build and avoid the inter-chroot dependency
between the sbom chroot and the image chroot.
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
meta/classes-recipe/rootfs.bbclass | 6 +-----
meta/classes/sbom.bbclass | 8 ++++++++
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/meta/classes-recipe/rootfs.bbclass b/meta/classes-recipe/rootfs.bbclass
index 16b1aa50..a96a392a 100644
--- a/meta/classes-recipe/rootfs.bbclass
+++ b/meta/classes-recipe/rootfs.bbclass
@@ -519,9 +519,6 @@ cache_dbg_pkgs() {
fi
}
-# The sbom generator needs the apt-cache, hence run before cleaning it
-ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('ROOTFS_FEATURES', 'generate-sbom', 'do_generate_sbom', '', d)}"
-
ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('ROOTFS_FEATURES', 'clean-package-cache', 'rootfs_postprocess_clean_package_cache', '', d)}"
rootfs_postprocess_clean_package_cache() {
run_in_chroot '${ROOTFSDIR}' \
@@ -615,6 +612,7 @@ EOSH
do_rootfs_postprocess[vardeps] = "${ROOTFS_POSTPROCESS_COMMAND}"
do_rootfs_postprocess[network] = "${TASK_USE_SUDO}"
+do_rootfs_postprocess[depends] = "base-apt:do_cache isar-apt:do_cache_config"
python do_rootfs_postprocess() {
# Take care that its correctly mounted:
bb.build.exec_func('rootfs_do_mounts', d)
@@ -665,8 +663,6 @@ python do_rootfs() {
}
addtask rootfs before do_build
-do_rootfs_postprocess[depends] = "base-apt:do_cache isar-apt:do_cache_config ${@bb.utils.contains('ROOTFS_FEATURES', 'generate-sbom', 'sbom-chroot:do_sbomchroot_deploy', '', d)}"
-
SSTATETASKS += "do_rootfs_install"
SSTATECREATEFUNCS += "rootfs_install_sstate_prepare"
SSTATEPOSTINSTFUNCS += "rootfs_install_sstate_finalize"
diff --git a/meta/classes/sbom.bbclass b/meta/classes/sbom.bbclass
index 34efb590..1801afac 100644
--- a/meta/classes/sbom.bbclass
+++ b/meta/classes/sbom.bbclass
@@ -78,6 +78,7 @@ cleanup_sbom_chroot() {
do_generate_sbom[dirs] += "${DEPLOY_DIR_SBOM}"
do_generate_sbom[network] = "${TASK_USE_SUDO}"
+do_generate_sbom[depends] += "sbom-chroot:do_sbomchroot_deploy"
python do_generate_sbom() {
sbom_doc_uuid(d)
try:
@@ -86,3 +87,10 @@ python do_generate_sbom() {
finally:
bb.build.exec_func("cleanup_sbom_chroot", 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)
+}
--
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-3-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 ` 'Felix Moessbauer' via isar-users [this message]
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 ` [PATCH 6/6] sbom: cache artifact in sstate cache 'Felix Moessbauer' via isar-users
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-3-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