aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2024-04-24 13:39:33 +0200
committerPaul Spooren <mail@aparcar.org>2024-05-07 22:26:10 +0200
commit6d4feb87f19a5d46f7c677fc41e4ebd4f0ad4a6b (patch)
tree3aaf070391301011f45e41ae9a37ce37afdd97ae
parent0d445dad9883fdc0383b37661f99fde8ebbaf9bc (diff)
build: also generate the CycloneDX SBOM in imagebuilder
The needed file '.packageinfo' for creating the CycloneDX SBOM in the imagebuilder is available in the top directory of the imagebuilder and not in the tmp directory. For this reason, the creation of the CycloneDX SBOM file is not available for the imagebuilder. To fix this, it is now first checked whether the CycloneDX SBOM should be built at all and then second decided by checking the IB variable where the '.packageinfo' file is to be found. With this change, it is now possible to create the CycloneDX SBOM also for the imagebuilder as well. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
-rw-r--r--include/image.mk9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/image.mk b/include/image.mk
index b6b796dd97..284298e5ed 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -279,12 +279,11 @@ endef
define Image/Manifest
$(call opkg,$(TARGET_DIR_ORIG)) list-installed > \
$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest
-ifndef IB
- $(if $(CONFIG_JSON_CYCLONEDX_SBOM), \
- $(SCRIPT_DIR)/package-metadata.pl imgcyclonedxsbom \
- $(TMP_DIR)/.packageinfo \
+ifneq ($(CONFIG_JSON_CYCLONEDX_SBOM),)
+ $(SCRIPT_DIR)/package-metadata.pl imgcyclonedxsbom \
+ $(if $(IB),$(TOPDIR)/.packageinfo, $(TMP_DIR)/.packageinfo) \
$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest > \
- $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).bom.cdx.json)
+ $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).bom.cdx.json
endif
endef