image: fix image generation within ImageBuilder
authorPetr Štetiar <ynezz@true.cz>
Mon, 6 Nov 2023 08:52:24 +0000 (08:52 +0000)
committerPetr Štetiar <ynezz@true.cz>
Mon, 6 Nov 2023 08:59:03 +0000 (08:59 +0000)
Changes introduced in commit d604a07225c5 ("build: add CycloneDX SBOM
JSON support") broke ImageBuilder:

  Cannot open '/openwrt-imagebuilder-ath79-generic.Linux-x86_64/tmp/.packageinfo': No such file or directory

So lets fix it by wrapping the BOM generation behind condition of IB
feature check.

Fixes: #13881
Fixes: d604a07225c5 ("build: add CycloneDX SBOM JSON support")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
include/image.mk

index 764410fe1883777e5ccf320a0de47c4ad5c373e8..9736e4e1642ed404d729c6932751127be6d09e0c 100644 (file)
@@ -277,11 +277,13 @@ 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 \
                $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest > \
                $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).bom.cdx.json)
+endif
 endef
 
 define Image/gzip-ext4-padded-squashfs