Skip to content

Commit

Permalink
build: also generate the CycloneDX SBOM in imagebuilder
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
feckert authored and aparcar committed May 7, 2024
1 parent 0d445da commit 6d4feb8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions include/image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6d4feb8

Please sign in to comment.