build: add version number to filenames
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 8 Jan 2015 11:02:00 +0000 (11:02 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 8 Jan 2015 11:02:00 +0000 (11:02 +0000)
This commit introduces a new option CONFIG_VERSION_FILENAMES which causes
OpenWrt to embed the version number in generated image files, SDK- and
ImageBuilder archives.

The option is enabled by default if CONFIG_VERSIONOPT is set.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
SVN-Revision: 43869

include/image.mk
package/base-files/image-config.in
target/imagebuilder/Makefile
target/sdk/Makefile

index 7375bf563f6bc6666cdd086097afb058ac2bd2f4..94e4438312a7bf599e4924838e2c36536ff3be5d 100644 (file)
@@ -9,6 +9,7 @@ override TARGET_BUILD=
 include $(INCLUDE_DIR)/prereq.mk
 include $(INCLUDE_DIR)/kernel.mk
 include $(INCLUDE_DIR)/host.mk
+include $(INCLUDE_DIR)/version.mk
 
 override MAKE:=$(_SINGLE)$(SUBMAKE)
 override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE)
@@ -16,7 +17,7 @@ override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE)
 KDIR=$(KERNEL_BUILD_DIR)
 DTS_DIR:=$(LINUX_DIR)/arch/$(ARCH)/boot/dts/
 
-IMG_PREFIX:=openwrt-$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))
+IMG_PREFIX:=openwrt-$(if $(CONFIG_VERSION_FILENAMES),$(VERSION_NUMBER)-)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))
 
 MKFS_DEVTABLE_OPT := -D $(INCLUDE_DIR)/device_table.txt
 
index 8859eb6f6a30c18a45412098888bda5757ea8a4e..1f0b2c86ea09c7db8c4edf4d4b646e5b8022c543 100644 (file)
@@ -206,6 +206,14 @@ if VERSIONOPT
                help
                        This is the hardware revision string embedded in /etc/device_info
                        Useful for OEMs building OpenWrt based firmware
+
+       config VERSION_FILENAMES
+               bool
+               prompt "Version number in filenames"
+               default y
+               help
+                       Enable this to include the version number in firmware image, SDK-
+                       and Image Builder archive file names
 endif
 
 
index 1a7cbbf9fe315133f216f8fc273cf712097e5909..82fdab40d8e51ba24617794867e7216b5cfc6575 100644 (file)
@@ -15,7 +15,7 @@ override MAKEFLAGS=
 PKG_OS:=$(word 2,$(subst -, ,$(shell $(HOSTCC) -dumpmachine)))
 PKG_CPU:=$(word 1,$(subst -, ,$(shell $(HOSTCC) -dumpmachine)))
 
-IB_NAME:=OpenWrt-ImageBuilder-$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET))-for-$(PKG_OS)-$(PKG_CPU)
+IB_NAME:=OpenWrt-ImageBuilder-$(if $(CONFIG_VERSION_FILENAMES),$(VERSION_NUMBER)-)$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET))-for-$(PKG_OS)-$(PKG_CPU)
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(IB_NAME)
 IB_KDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(KERNEL_BUILD_DIR))
 IB_LDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(LINUX_DIR))
index cdfb2c8c45f2c2eb8704abf9775c619963948836..9e8749b080f9dca904c0c32e5cfd1cff4810cc7e 100644 (file)
@@ -8,13 +8,14 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 include $(INCLUDE_DIR)/host.mk
+include $(INCLUDE_DIR)/version.mk
 
 override MAKEFLAGS=
 
 PKG_OS:=$(word 2,$(subst -, ,$(shell $(HOSTCC) -dumpmachine)))
 PKG_CPU:=$(word 1,$(subst -, ,$(shell $(HOSTCC) -dumpmachine)))
 
-SDK_NAME:=OpenWrt-SDK-$(BOARD)-for-$(PKG_OS)-$(PKG_CPU)-gcc-$(GCCV)_$(LIBC)-$(LIBCV)
+SDK_NAME:=OpenWrt-SDK-$(if $(CONFIG_VERSION_FILENAMES),$(VERSION_NUMBER)-)$(BOARD)-for-$(PKG_OS)-$(PKG_CPU)-gcc-$(GCCV)_$(LIBC)-$(LIBCV)
 SDK_BUILD_DIR:=$(BUILD_DIR)/$(SDK_NAME)
 
 STAGING_SUBDIR_HOST := staging_dir/host