EXPORT_FUNCTIONS do_deploy
-python __anonymous() {
- inherits = (d.getVar("INHERIT") or "")
- if "create-spdx" in inherits:
- bb.build.addtask('do_create_kernel_config_spdx', 'do_populate_lic do_deploy', 'do_create_spdx', d)
-}
+do_create_spdx:append() {
+ def create_kernel_config_spdx(d):
+ if not bb.data.inherits_class("create-spdx-3.0", d):
+ return
+ if d.getVar("SPDX_INCLUDE_KERNEL_CONFIG", True) != "1":
+ return
-python do_create_kernel_config_spdx() {
- if d.getVar("SPDX_INCLUDE_KERNEL_CONFIG", True) == "1":
import oe.spdx30
import oe.spdx30_tasks
from pathlib import Path
except Exception as e:
bb.error(f"Failed to parse kernel config file: {e}")
- build, build_objset = oe.sbom30.find_root_obj_in_jsonld(
- d, "recipes", f"recipe-{pn}", oe.spdx30.build_Build
- )
+ path = oe.sbom30.jsonld_arch_path(d, pkg_arch, "recipes", f"recipe-{pn}", deploydir=deploydir)
+ build_objset = oe.sbom30.load_jsonld(d, path, required=True)
+ build = build_objset.find_root(oe.spdx30.build_Build)
+ if not build:
+ bb.fatal("No root %s found in %s" % (oe.spdx30.build_Build.__name__, path))
kernel_build = build_objset.add_root(
oe.spdx30.build_Build(
[kernel_build]
)
- oe.sbom30.write_jsonld_doc(d, build_objset, deploydir / pkg_arch / "recipes" / f"recipe-{pn}.spdx.json")
+ oe.sbom30.write_jsonld_doc(d, build_objset, path)
+
+ create_kernel_config_spdx(d)
}
-do_create_kernel_config_spdx[depends] = "virtual/kernel:do_configure"
+do_create_spdx[depends] += "virtual/kernel:do_configure"
# Add using Device Tree support
inherit kernel-devicetree