[openwrt/openwrt] build: add ALT5 vendor/model/variant

LEDE Commits lede-commits at lists.infradead.org
Sat Jul 8 11:19:44 PDT 2023


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/95330a5d605715179cc7e4047cbeaf66b097fc87

commit 95330a5d605715179cc7e4047cbeaf66b097fc87
Author: Wenli Looi <wlooi at ucalgary.ca>
AuthorDate: Sat Jul 1 17:37:17 2023 +0000

    build: add ALT5 vendor/model/variant
    
    This allows adding another device variant.
    
    Signed-off-by: Wenli Looi <wlooi at ucalgary.ca>
---
 include/image.mk               | 21 ++++++++++++++++++++-
 scripts/json_add_image_info.py |  2 +-
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index fae4d32a8b..8f0cbead10 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -346,6 +346,7 @@ define Device/InitProfile
   DEVICE_ALT2_TITLE = $$(DEVICE_ALT2_VENDOR) $$(DEVICE_ALT2_MODEL)$$(if $$(DEVICE_ALT2_VARIANT), $$(DEVICE_ALT2_VARIANT))
   DEVICE_ALT3_TITLE = $$(DEVICE_ALT3_VENDOR) $$(DEVICE_ALT3_MODEL)$$(if $$(DEVICE_ALT3_VARIANT), $$(DEVICE_ALT3_VARIANT))
   DEVICE_ALT4_TITLE = $$(DEVICE_ALT4_VENDOR) $$(DEVICE_ALT4_MODEL)$$(if $$(DEVICE_ALT4_VARIANT), $$(DEVICE_ALT4_VARIANT))
+  DEVICE_ALT5_TITLE = $$(DEVICE_ALT5_VENDOR) $$(DEVICE_ALT5_MODEL)$$(if $$(DEVICE_ALT5_VARIANT), $$(DEVICE_ALT5_VARIANT))
   DEVICE_VENDOR :=
   DEVICE_MODEL :=
   DEVICE_VARIANT :=
@@ -364,6 +365,9 @@ define Device/InitProfile
   DEVICE_ALT4_VENDOR :=
   DEVICE_ALT4_MODEL :=
   DEVICE_ALT4_VARIANT :=
+  DEVICE_ALT5_VENDOR :=
+  DEVICE_ALT5_MODEL :=
+  DEVICE_ALT5_VARIANT :=
   DEVICE_PACKAGES :=
   DEVICE_DESCRIPTION = Build firmware images for $$(DEVICE_TITLE)
 endef
@@ -448,7 +452,8 @@ DEFAULT_DEVICE_VARS := \
   DEVICE_ALT1_VENDOR DEVICE_ALT1_MODEL DEVICE_ALT1_VARIANT \
   DEVICE_ALT2_VENDOR DEVICE_ALT2_MODEL DEVICE_ALT2_VARIANT \
   DEVICE_ALT3_VENDOR DEVICE_ALT3_MODEL DEVICE_ALT3_VARIANT \
-  DEVICE_ALT4_VENDOR DEVICE_ALT4_MODEL DEVICE_ALT4_VARIANT
+  DEVICE_ALT4_VENDOR DEVICE_ALT4_MODEL DEVICE_ALT4_VARIANT \
+  DEVICE_ALT5_VENDOR DEVICE_ALT5_MODEL DEVICE_ALT5_VARIANT
 
 define Device/ExportVar
   $(1) : $(2):=$$($(2))
@@ -537,6 +542,9 @@ define Device/Build/initramfs
 	DEVICE_ALT4_VENDOR="$$(DEVICE_ALT4_VENDOR)" \
 	DEVICE_ALT4_MODEL="$$(DEVICE_ALT4_MODEL)" \
 	DEVICE_ALT4_VARIANT="$$(DEVICE_ALT4_VARIANT)" \
+	DEVICE_ALT5_VENDOR="$$(DEVICE_ALT5_VENDOR)" \
+	DEVICE_ALT5_MODEL="$$(DEVICE_ALT5_MODEL)" \
+	DEVICE_ALT5_VARIANT="$$(DEVICE_ALT5_VARIANT)" \
 	DEVICE_TITLE="$$(DEVICE_TITLE)" \
 	DEVICE_PACKAGES="$$(DEVICE_PACKAGES)" \
 	TARGET="$(BOARD)" \
@@ -668,6 +676,9 @@ define Device/Build/image
 	DEVICE_ALT4_VENDOR="$(DEVICE_ALT4_VENDOR)" \
 	DEVICE_ALT4_MODEL="$(DEVICE_ALT4_MODEL)" \
 	DEVICE_ALT4_VARIANT="$(DEVICE_ALT4_VARIANT)" \
+	DEVICE_ALT5_VENDOR="$(DEVICE_ALT5_VENDOR)" \
+	DEVICE_ALT5_MODEL="$(DEVICE_ALT5_MODEL)" \
+	DEVICE_ALT5_VARIANT="$(DEVICE_ALT5_VARIANT)" \
 	DEVICE_TITLE="$(DEVICE_TITLE)" \
 	DEVICE_PACKAGES="$(DEVICE_PACKAGES)" \
 	TARGET="$(BOARD)" \
@@ -719,6 +730,9 @@ define Device/Build/artifact
 	DEVICE_ALT4_VENDOR="$(DEVICE_ALT4_VENDOR)" \
 	DEVICE_ALT4_MODEL="$(DEVICE_ALT4_MODEL)" \
 	DEVICE_ALT4_VARIANT="$(DEVICE_ALT4_VARIANT)" \
+	DEVICE_ALT5_VENDOR="$(DEVICE_ALT5_VENDOR)" \
+	DEVICE_ALT5_MODEL="$(DEVICE_ALT5_MODEL)" \
+	DEVICE_ALT5_VARIANT="$(DEVICE_ALT5_VARIANT)" \
 	DEVICE_TITLE="$(DEVICE_TITLE)" \
 	DEVICE_PACKAGES="$(DEVICE_PACKAGES)" \
 	TARGET="$(BOARD)" \
@@ -762,6 +776,7 @@ $(if $(strip $(DEVICE_ALT1_TITLE)),- $(DEVICE_ALT1_TITLE))
 $(if $(strip $(DEVICE_ALT2_TITLE)),- $(DEVICE_ALT2_TITLE))
 $(if $(strip $(DEVICE_ALT3_TITLE)),- $(DEVICE_ALT3_TITLE))
 $(if $(strip $(DEVICE_ALT4_TITLE)),- $(DEVICE_ALT4_TITLE))
+$(if $(strip $(DEVICE_ALT5_TITLE)),- $(DEVICE_ALT5_TITLE))
 @@
 
 endef
@@ -787,6 +802,10 @@ ifneq ($$(strip $$(DEVICE_ALT4_TITLE)),)
 DEVICE_DISPLAY = $$(DEVICE_ALT4_TITLE) ($$(DEVICE_TITLE))
 $$(info $$(call Device/DumpInfo,$(1)))
 endif
+ifneq ($$(strip $$(DEVICE_ALT5_TITLE)),)
+DEVICE_DISPLAY = $$(DEVICE_ALT5_TITLE) ($$(DEVICE_TITLE))
+$$(info $$(call Device/DumpInfo,$(1)))
+endif
 DEVICE_DISPLAY = $$(DEVICE_TITLE)
 $$(eval $$(if $$(DEVICE_TITLE),$$(info $$(call Device/DumpInfo,$(1)))))
 endef
diff --git a/scripts/json_add_image_info.py b/scripts/json_add_image_info.py
index 0c441b9334..3aeb7ba5fc 100755
--- a/scripts/json_add_image_info.py
+++ b/scripts/json_add_image_info.py
@@ -21,7 +21,7 @@ if not file_path.is_file():
 
 def get_titles():
     titles = []
-    for prefix in ["", "ALT0_", "ALT1_", "ALT2_", "ALT3_", "ALT4_"]:
+    for prefix in ["", "ALT0_", "ALT1_", "ALT2_", "ALT3_", "ALT4_", "ALT5_"]:
         title = {}
         for var in ["vendor", "model", "variant"]:
             if getenv("DEVICE_{}{}".format(prefix, var.upper())):




More information about the lede-commits mailing list