summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Woodhouse2025-11-29 16:18:26 +0000
committerPetr Štetiar2025-12-12 22:08:27 +0000
commit74c8435ebde1b8b104fcbff6a2c918051c561660 (patch)
tree846db7779e455c19ecae9d0603f97ec212833fc9
parent25f32651f8f7146144f5678f3ebb8c54beca071c (diff)
downloadopenwrt-74c8435ebde1b8b104fcbff6a2c918051c561660.tar.gz
image: add CONFIG_EXTRA_IMAGE_NAME
This allows an optional tag to be put in the .config file which is included in the filename of the resulting images, so it's easier to build images with different functionality for the same target hardware. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Link: https://github.com/openwrt/openwrt/pull/20984 Signed-off-by: Petr Štetiar <ynezz@true.cz> (cherry picked from commit 24b8db118b6c84b92d17f969794b2bd6d73b8cdc)
-rw-r--r--include/image.mk3
-rw-r--r--package/base-files/image-config.in8
2 files changed, 11 insertions, 0 deletions
diff --git a/include/image.mk b/include/image.mk
index 0fbaf66dd1..38005b2ab2 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -41,6 +41,9 @@ KDIR=$(KERNEL_BUILD_DIR)
KDIR_TMP=$(KDIR)/tmp
DTS_DIR:=$(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts
+ifeq ($(EXTRA_IMAGE_NAME),)
+EXTRA_IMAGE_NAME:=$(call qstrip,$(CONFIG_EXTRA_IMAGE_NAME))
+endif
IMG_PREFIX_EXTRA:=$(if $(EXTRA_IMAGE_NAME),$(call sanitize,$(EXTRA_IMAGE_NAME))-)
IMG_PREFIX_VERNUM:=$(if $(CONFIG_VERSION_FILENAMES),$(call sanitize,$(VERSION_NUMBER))-)
IMG_PREFIX_VERCODE:=$(if $(CONFIG_VERSION_CODE_FILENAMES),$(call sanitize,$(VERSION_CODE))-)
diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in
index f1439550b0..5c3e157846 100644
--- a/package/base-files/image-config.in
+++ b/package/base-files/image-config.in
@@ -5,6 +5,14 @@
# See /LICENSE for more information.
#
+config EXTRA_IMAGE_NAME
+ string
+ prompt "Extra image filename" if IMAGEOPT
+ default ""
+ help
+ Add this to the output image filenames, to distinguish between
+ different builds for the same hardware type.
+
config TARGET_DEFAULT_LAN_IP_FROM_PREINIT
bool "Use preinit IP configuration as default LAN IP" if IMAGEOPT
default n