[OpenWrt-Devel] [PATCH 10/14] config: Move version configuration out of base-files

openwrt at daniel.thecshore.com openwrt at daniel.thecshore.com
Sun Jan 3 01:02:58 EST 2016


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

In preparation for allowing menuconfig of version information from
withing SDK/Imagebuilder, move version configuration out of base-files
(because base-files may not be present in those cases).

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 Config.in                          |   2 +
 config/Config-version.in           | 113 +++++++++++++++++++++++++++++++++++++
 package/base-files/image-config.in | 110 ------------------------------------
 target/sdk/files/Config.in         |  11 ++++
 4 files changed, 126 insertions(+), 110 deletions(-)
 create mode 100644 config/Config-version.in

diff --git a/Config.in b/Config.in
index d30c048..681125e 100644
--- a/Config.in
+++ b/Config.in
@@ -31,4 +31,6 @@ source "target/sdk/Config.in"
 
 source "target/toolchain/Config.in"
 
+source "config/Config-version.in"
+
 source "tmp/.config-package.in"
diff --git a/config/Config-version.in b/config/Config-version.in
new file mode 100644
index 0000000..f995b92
--- /dev/null
+++ b/config/Config-version.in
@@ -0,0 +1,113 @@
+menuconfig VERSIONOPT
+	bool "Version configuration options"
+	default n
+	help
+		These options allow to override the version information embedded in
+		the /etc/openwrt_version, /etc/openwrt_release, /etc/banner and
+		/etc/opkg.conf files. Usually there is no need to set these, but
+		they're useful for release builds or custom OpenWrt redistributions
+		that should carry custom version tags.
+		These options also override default filenames for SDK,
+		Imagebuilder, and images.
+
+if VERSIONOPT
+
+	config VERSION_DIST
+		string
+		prompt "Release distribution"
+		default "OpenWrt"
+		help
+			This is the name of the release distribution.
+			If unspecified, it defaults to OpenWrt.
+
+	config VERSION_NICK
+		string
+		prompt "Release version nickname"
+		help
+			This is the release codename embedded in the image.
+			If unspecified, it defaults to the name of source branch.
+
+	config VERSION_NUMBER
+		string
+		prompt "Release version number"
+		help
+			This is the release version number embedded in the image.
+			If unspecified, it defaults to the svn or git-svn revision
+			of the build tree.
+
+	config VERSION_REPO
+		string
+		prompt "Release repository"
+		default "http://downloads.openwrt.org/snapshots/trunk/%S/packages"
+		help
+			This is the repository address embedded in the image, it defaults
+			to the trunk snapshot repo; the url may contain the following placeholders:
+			 %R .. Revision number
+			 %V .. Release version or revision number, uppercase
+			 %v .. Release version or revision number, lowercase
+			 %C .. Release version or "Bleeding Edge", uppercase
+			 %c .. Release version or "bleeding_edge", lowercase
+			 %N .. Release name, uppercase
+			 %n .. Release name, lowercase
+			 %D .. Distribution name or "OpenWrt", uppercase
+			 %d .. Distribution name or "openwrt", lowercase
+			 %F .. Flavour, uppercase
+			 %f .. flavour, lowercase
+			 %T .. Target name
+			 %S .. Target/Subtarget name
+			 %t .. Build taint flags, e.g. "no-all busybox"
+			 %M .. Manufacturer name or "OpenWrt"
+			 %P .. Product name or "Generic"
+			 %h .. Hardware revision or "v0"
+
+	config VERSION_MANUFACTURER
+		string
+		prompt "Manufacturer name"
+		help
+			This is the manufacturer name embedded in /etc/device_info
+			Useful for OEMs building OpenWrt based firmware
+
+	config VERSION_MANUFACTURER_URL
+		string
+		prompt "Manufacturer URL"
+		help
+			This is an URL to the manufacturer's website embedded in /etc/device_info
+			Useful for OEMs building OpenWrt based firmware
+
+	config VERSION_PRODUCT
+		string
+		prompt "Product name"
+		help
+			This is the product name embedded in /etc/device_info
+			Useful for OEMs building OpenWrt based firmware
+
+	config VERSION_HWREV
+		string
+		prompt "Hardware revision"
+		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
+
+	config VERSION_FLAVOUR
+		string
+		prompt "Release flavour"
+		help
+			This is an optional string that gets added to
+			output filenames and is part of the version id,
+			which identifies a 'flavour' of build (for example
+			for differentiating between SDK's/images build with
+			NAS vs router appropriate settings).
+			It is enabled by default when using the SDK
+			and building a second SDK (so filenames will
+			be distinct).
+
+endif
+
diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in
index bc865e3..6fed6fd 100644
--- a/package/base-files/image-config.in
+++ b/package/base-files/image-config.in
@@ -131,116 +131,6 @@ menuconfig INITOPT
 			previous versions of OpenWrt.  Removing this does nothing if
 			stderr is suppressed during preinit (which is the default).
 
-
-menuconfig VERSIONOPT
-	bool "Version configuration options" if IMAGEOPT
-	default n
-	help
-		These options allow to override the version information embedded in
-		the /etc/openwrt_version, /etc/openwrt_release, /etc/banner and
-		/etc/opkg.conf files. Usually there is no need to set these, but
-		they're useful for release builds or custom OpenWrt redistributions
-		that should carry custom version tags.
-
-if VERSIONOPT
-
-	config VERSION_DIST
-		string
-		prompt "Release distribution"
-		default "OpenWrt"
-		help
-			This is the name of the release distribution.
-			If unspecified, it defaults to OpenWrt.
-
-	config VERSION_FLAVOUR
-		string
-		prompt "Release flavour"
-		default ""
-		help
-			This is an optional string that gets added to
-			output filenames and is part of the version id,
-			which identifies a 'flavour' of build (for example
-			for differentiating between SDK's/images build with
-			NAS vs router appropriate settings).
-
-	config VERSION_NICK
-		string
-		prompt "Release version nickname"
-		help
-			This is the release codename embedded in the image.
-			If unspecified, it defaults to the name of source branch.
-
-	config VERSION_NUMBER
-		string
-		prompt "Release version number"
-		help
-			This is the release version number embedded in the image.
-			If unspecified, it defaults to the svn or git-svn revision
-			of the build tree.
-
-	config VERSION_REPO
-		string
-		prompt "Release repository"
-		default "http://downloads.openwrt.org/snapshots/trunk/%S/packages"
-		help
-			This is the repository address embedded in the image, it defaults
-			to the trunk snapshot repo; the url may contain the following placeholders:
-			 %R .. Revision number
-			 %V .. Release version or revision number, uppercase
-			 %v .. Release version or revision number, lowercase
-			 %C .. Release version or "Bleeding Edge", uppercase
-			 %c .. Release version or "bleeding_edge", lowercase
-			 %N .. Release name, uppercase
-			 %n .. Release name, lowercase
-			 %D .. Distribution name or "OpenWrt", uppercase
-			 %d .. Distribution name or "openwrt", lowercase
-			 %F .. Flavour, uppercase
-			 %f .. flavour, lowercase
-			 %T .. Target name
-			 %S .. Target/Subtarget name
-			 %t .. Build taint flags, e.g. "no-all busybox"
-			 %M .. Manufacturer name or "OpenWrt"
-			 %P .. Product name or "Generic"
-			 %h .. Hardware revision or "v0"
-
-	config VERSION_MANUFACTURER
-		string
-		prompt "Manufacturer name"
-		help
-			This is the manufacturer name embedded in /etc/device_info
-			Useful for OEMs building OpenWrt based firmware
-
-	config VERSION_MANUFACTURER_URL
-		string
-		prompt "Manufacturer URL"
-		help
-			This is an URL to the manufacturer's website embedded in /etc/device_info
-			Useful for OEMs building OpenWrt based firmware
-
-	config VERSION_PRODUCT
-		string
-		prompt "Product name"
-		help
-			This is the product name embedded in /etc/device_info
-			Useful for OEMs building OpenWrt based firmware
-
-	config VERSION_HWREV
-		string
-		prompt "Hardware revision"
-		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
-
-
 menuconfig PER_FEED_REPO
 	bool "Separate feed repositories" if IMAGEOPT
 	default y
diff --git a/target/sdk/files/Config.in b/target/sdk/files/Config.in
index 6cb3fe8..45f2faf 100644
--- a/target/sdk/files/Config.in
+++ b/target/sdk/files/Config.in
@@ -1,7 +1,18 @@
+# Copyright (C) 2006-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
 config MODULES
 	bool
 	default y
 	option modules
 
+mainmenu "OpenWrt Configuration"
+
 source "Config-build.in"
+
+source "config/Config-version.in"
+
 source "tmp/.config-package.in"
-- 
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