[OpenWrt-Devel] [PATCH 3/4] images: use configured distribution name for output image names

openwrt at daniel.thecshore.com openwrt at daniel.thecshore.com
Thu Dec 17 23:24:55 EST 2015


From: Daniel Dickinson <openwrt at daniel.thecshore.com>

We allow to configure the version distribution name;
let's also use it for the final image filenames.

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 include/image.mk | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 37eb28a..445b1f0 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -18,7 +18,21 @@ KDIR=$(KERNEL_BUILD_DIR)
 KDIR_TMP=$(KDIR)/tmp
 DTS_DIR:=$(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts
 
-IMG_PREFIX:=openwrt-$(if $(CONFIG_VERSION_FILENAMES),$(VERSION_NUMBER)-)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))
+define toupper
+$(shell echo $(1) | tr '[:lower:]' '[:upper:]')
+endef
+
+define tolower
+$(shell echo $(1) | tr '[:upper:]' '[:lower:]')
+endef
+
+define sanitize
+$(shell echo $(call tolower,$(1)) | sed 's/_/-/g')
+endef
+
+DIST_SANITIZED:=$(call sanitize,$(VERSION_DIST))
+
+IMG_PREFIX:=$(DIST_SANITIZED)-$(if $(CONFIG_VERSION_FILENAMES),$(VERSION_NUMBER)-)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))
 
 MKFS_DEVTABLE_OPT := -D $(INCLUDE_DIR)/device_table.txt
 
@@ -86,18 +100,6 @@ define add_jffs2_mark
 	echo -ne '\xde\xad\xc0\xde' >> $(1)
 endef
 
-define toupper
-$(shell echo $(1) | tr '[:lower:]' '[:upper:]')
-endef
-
-define tolower
-$(shell echo $(1) | tr '[:upper:]' '[:lower:]')
-endef
-
-define sanitize
-$(shell echo $(call tolower,$(1)) | sed 's/_/-/g')
-endef
-
 PROFILE_SANITIZED := $(call sanitize,$(PROFILE))
 
 define split_args
-- 
2.4.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list