|
| 1 | +From cfadbc090c3f2f886eecb20b0272a32de4b74194 Mon Sep 17 00:00:00 2001 |
| 2 | +From: =?UTF-8?q?Petr=20=C5=A0tetiar?= <ynezz@true.cz> |
| 3 | +Date: Mon, 6 Nov 2023 08:52:24 +0000 |
| 4 | +Subject: [PATCH] image: fix image generation within ImageBuilder |
| 5 | +MIME-Version: 1.0 |
| 6 | +Content-Type: text/plain; charset=UTF-8 |
| 7 | +Content-Transfer-Encoding: 8bit |
| 8 | + |
| 9 | +Changes introduced in commit d604a07225c5 ("build: add CycloneDX SBOM |
| 10 | +JSON support") broke ImageBuilder: |
| 11 | + |
| 12 | + Cannot open '/openwrt-imagebuilder-ath79-generic.Linux-x86_64/tmp/.packageinfo': No such file or directory |
| 13 | + |
| 14 | +So lets fix it by wrapping the BOM generation behind condition of IB |
| 15 | +feature check. |
| 16 | + |
| 17 | +Fixes: #13881 |
| 18 | +Fixes: d604a07225c5 ("build: add CycloneDX SBOM JSON support") |
| 19 | +Signed-off-by: Petr Štetiar <ynezz@true.cz> |
| 20 | +(cherry picked from commit c4259a658673cc1a02ed17bfa8e94de17de00ad2) |
| 21 | +--- |
| 22 | + include/image.mk | 2 ++ |
| 23 | + 1 file changed, 2 insertions(+) |
| 24 | + |
| 25 | +diff --git a/include/image.mk b/include/image.mk |
| 26 | +index 3d5d6c1613..62e05b2567 100644 |
| 27 | +--- a/include/image.mk |
| 28 | ++++ b/include/image.mk |
| 29 | +@@ -277,11 +277,13 @@ endef |
| 30 | + define Image/Manifest |
| 31 | + $(call opkg,$(TARGET_DIR_ORIG)) list-installed > \ |
| 32 | + $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest |
| 33 | ++ifndef IB |
| 34 | + $(if $(CONFIG_JSON_CYCLONEDX_SBOM), \ |
| 35 | + $(SCRIPT_DIR)/package-metadata.pl imgcyclonedxsbom \ |
| 36 | + $(TMP_DIR)/.packageinfo \ |
| 37 | + $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest > \ |
| 38 | + $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).bom.cdx.json) |
| 39 | ++endif |
| 40 | + endef |
| 41 | + |
| 42 | + define Image/gzip-ext4-padded-squashfs |
| 43 | +-- |
| 44 | +2.41.0 |
| 45 | + |
0 commit comments