diff mbox series

[2/8] lib/oe: add fitimage to BBIMPORTS

Message ID 20261203143044.592073-3-adrian.freihofer@siemens.com
State Under Review
Headers show
Series uboot-sign: prepare for HSM-backed FIT signing | expand

Commit Message

AdrianF Dec. 3, 2026, 2:30 p.m. UTC
From: Adrian Freihofer <adrian.freihofer@siemens.com>

The code of oe.fitimage was not part of the task hash of the
kernel-fit-image do_compile task. A change of the generated its file
or of the mkimage calls did not trigger a rebuild of the FIT image and
an outdated FIT image could be restored from sstate.

Add fitimage to BBIMPORTS. Then the code parser scans the functions and
classes of the module and the ones used by do_compile become task
dependencies.

The code parser only detects classes which are called, but not base
classes. The ItsNode base class implements the emit function which
writes the its file. Add it explicitly to the vardeps of do_compile.

oe.fitimage does not access the datastore. All variables are read in
do_compile and passed as arguments. Hence no new variable dependencies
are added.

Tested with bitbake -S none linux-yocto-fitimage. The do_compile
signature changes after modifying ItsNode, ItsNodeRootKernel or
symlink_points_below and is restored after reverting the modification.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
 meta/classes-recipe/kernel-fit-image.bbclass | 2 ++
 meta/lib/oe/__init__.py                      | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/kernel-fit-image.bbclass b/meta/classes-recipe/kernel-fit-image.bbclass
index 0c8dac23ee..c167fc8c64 100644
--- a/meta/classes-recipe/kernel-fit-image.bbclass
+++ b/meta/classes-recipe/kernel-fit-image.bbclass
@@ -216,6 +216,8 @@  python do_compile() {
     root_node.run_mkimage_sign(fitname)
 }
 do_compile[depends] += "virtual/kernel:do_deploy"
+# Base classes are not detected by the code parser, only called classes are
+do_compile[vardeps] += "oe.fitimage.ItsNode"
 
 do_install() {
     install -d "${D}/${KERNEL_IMAGEDEST}"
diff --git a/meta/lib/oe/__init__.py b/meta/lib/oe/__init__.py
index 1e47934e6f..fcef7c5747 100644
--- a/meta/lib/oe/__init__.py
+++ b/meta/lib/oe/__init__.py
@@ -12,4 +12,4 @@  __path__ = extend_path(__path__, __name__)
 BBIMPORTS = ["qa", "data", "path", "utils", "types", "package", "packagedata", \
              "packagegroup", "sstatesig", "lsb", "cachedpath", "license", "qemu", \
              "reproducible", "rust", "buildcfg", "go", "spdx30_tasks", "spdx_common", \
-             "cve_check", "tune", "classextend", "purl", "kernel", "kernel_module", "sanity"]
+             "cve_check", "tune", "classextend", "purl", "kernel", "kernel_module", "sanity", "fitimage"]