Skip to content

Commit 98b36df

Browse files
committed
imagebuilder: temporary fix for a few days
1 parent 02244f6 commit 98b36df

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+

roles/cfg_openwrt/tasks/imagebuilder.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@
102102
search_string: "compat_version=$(if $(DEVICE_COMPAT_VERSION),$(DEVICE_COMPAT_VERSION),1.0)"
103103
line: "compat_version=9.9"
104104

105+
- name: Patch image.mk to fix temporary breakage
106+
patch:
107+
src: "0001-image-fix-image-generation-within-ImageBuilder.patch"
108+
dest: "{{ imagebuild_dir }}/include/image.mk"
109+
105110
- name: Run Imagebuilder
106111
changed_when: false
107112
command:

0 commit comments

Comments
 (0)