]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
image: add CONFIG_EXTRA_IMAGE_NAME
authorDavid Woodhouse <dwmw2@infradead.org>
Sat, 29 Nov 2025 16:18:26 +0000 (16:18 +0000)
committerPetr Štetiar <ynezz@true.cz>
Fri, 12 Dec 2025 22:08:27 +0000 (22:08 +0000)
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)

include/image.mk
package/base-files/image-config.in

index 0fbaf66dd14c9778b78b671863ec076b0c15a838..38005b2ab2b417ba2d4dc99f2f9d69168c551a81 100644 (file)
@@ -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))-)
index f1439550b0beab3075e54532bf693ed260b66e1e..5c3e1578463d092cefa1157ce4cffe0e041a6ffd 100644 (file)
@@ -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