base-files: Add standard os-release file
authorDaniel Dickinson <lede@daniel.thecshore.com>
Wed, 18 May 2016 13:07:30 +0000 (09:07 -0400)
committerJo-Philipp Wich <jo@mein.io>
Fri, 24 Jun 2016 11:52:53 +0000 (13:52 +0200)
/etc/os-release is the standard distribution release information
file, therefore add it (and image configuration options for
fields not previously present in LEDE).  Once it is deemed
reasonable the non-standard openwrt_release, openwrt_version,
and device_info files could be removed (that is with this patch
we consider them deprecated in favour of the standard file).

Signed-off-by: Daniel Dickinson <lede@daniel.thecshore.com>
include/version.mk
package/base-files/Makefile
package/base-files/files/etc/os-release [new symlink]
package/base-files/files/usr/lib/os-release [new file with mode: 0644]
package/base-files/image-config.in

index 88d6245fcd5bc73c006a44a882de2e86105f0633..b54eaab4858d7d5c8a1da7f081c342e64883f25e 100644 (file)
@@ -12,6 +12,7 @@
 RELEASE:=Reboot
 
 PKG_CONFIG_DEPENDS += \
+       CONFIG_VERSION_BUG_URL \
        CONFIG_VERSION_NUMBER \
        CONFIG_VERSION_NICK \
        CONFIG_VERSION_REPO \
@@ -19,6 +20,7 @@ PKG_CONFIG_DEPENDS += \
        CONFIG_VERSION_MANUFACTURER \
        CONFIG_VERSION_MANUFACTURER_URL \
        CONFIG_VERSION_PRODUCT \
+       CONFIG_VERSION_SUPPORT_URL \
        CONFIG_VERSION_HWREV \
 
 qstrip_escape=$(subst ','\'',$(call qstrip,$(1)))
@@ -48,6 +50,12 @@ VERSION_MANUFACTURER:=$(if $(VERSION_MANUFACTURER),$(VERSION_MANUFACTURER),LEDE)
 VERSION_MANUFACTURER_URL:=$(call qstrip_escape,$(CONFIG_VERSION_MANUFACTURER_URL))
 VERSION_MANUFACTURER_URL:=$(if $(VERSION_MANUFACTURER_URL),$(VERSION_MANUFACTURER_URL),http://www.lede-project.org/)
 
+VERSION_BUG_URL:=$(call qstrip_escape,$(CONFIG_VERSION_BUG_URL))
+VERSION_BUG_URL:=$(if $(VERSION_BUG_URL),$(VERSION_BUG_URL),https://www.lede-project.org/development.html)
+
+VERSION_SUPPORT_URL:=$(call qstrip_escape,$(CONFIG_VERSION_SUPPORT_URL))
+VERSION_SUPPORT_URL:=$(if $(VERSION_SUPPORT_URL),$(VERSION_SUPPORT_URL),http://lists.infradead.org/mailman/listinfo/lede-dev)
+
 VERSION_PRODUCT:=$(call qstrip_escape,$(CONFIG_VERSION_PRODUCT))
 VERSION_PRODUCT:=$(if $(VERSION_PRODUCT),$(VERSION_PRODUCT),Generic)
 
@@ -94,6 +102,8 @@ VERSION_SED:=$(SED) 's,%U,$(VERSION_REPO),g' \
        -e 's,%t,$(VERSION_TAINTS),g' \
        -e 's,%M,$(VERSION_MANUFACTURER),g' \
        -e 's,%m,$(VERSION_MANUFACTURER_URL),g' \
+       -e 's,%b,$(VERSION_BUG_URL),g' \
+       -e 's,%s,$(VERSION_SUPPORT_URL),g' \
        -e 's,%P,$(VERSION_PRODUCT),g' \
        -e 's,%h,$(VERSION_HWREV),g'
 
index e51d65ac4260cd6abcf255e87537a35b858bc59f..5cfb0190801a52be5327d4250921b743a394e5fd 100644 (file)
@@ -138,11 +138,13 @@ define Package/base-files/install
 
        $(VERSION_SED) \
                $(1)/etc/banner \
-               $(1)/etc/openwrt_version
+               $(1)/etc/openwrt_version \
+               $(1)/usr/lib/os-release
 
        $(VERSION_SED_SCRIPT) \
                $(1)/etc/openwrt_release \
-               $(1)/etc/device_info
+               $(1)/etc/device_info \
+               $(1)/usr/lib/os-release
 
        $(SED) "s#%PATH%#$(TARGET_INIT_PATH)#g" \
                $(1)/sbin/hotplug-call \
diff --git a/package/base-files/files/etc/os-release b/package/base-files/files/etc/os-release
new file mode 120000 (symlink)
index 0000000..c4c75b4
--- /dev/null
@@ -0,0 +1 @@
+../usr/lib/os-release
\ No newline at end of file
diff --git a/package/base-files/files/usr/lib/os-release b/package/base-files/files/usr/lib/os-release
new file mode 100644 (file)
index 0000000..6c829e0
--- /dev/null
@@ -0,0 +1,17 @@
+NAME="%D"
+VERSION="%V, %N"
+ID="%d"
+ID_LIKE="lede openwrt"
+PRETTY_NAME="%D %N %V"
+VERSION_ID="%v"
+HOME_URL="%m"
+BUG_URL="%b"
+SUPPORT_URL="%s"
+BUILD_ID="%R"
+LEDE_BOARD="%S"
+LEDE_TAINTS="%t"
+LEDE_DEVICE_MANUFACTURER="%M"
+LEDE_DEVICE_MANUFACTURER_URL="%m"
+LEDE_DEVICE_PRODUCT="%P"
+LEDE_DEVICE_REVISION="%h"
+LEDE_RELEASE="%C"
index ef1d76790a4730a05afd9534c7355965320d4f8e..43d3859301487391394a6838e88701e5b37916e9 100644 (file)
@@ -148,10 +148,10 @@ menuconfig VERSIONOPT
        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.
+               the /etc/openwrt_version, /etc/openwrt_release, /etc/banner,
+               /etc/opkg.conf, and /etc/os-release 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
 
@@ -216,6 +216,18 @@ if VERSIONOPT
                        This is an URL to the manufacturer's website embedded in /etc/device_info
                        Useful for OEMs building OpenWrt based firmware
 
+       config VERSION_BUG_URL
+               string
+               prompt "Bug reporting URL"
+               help
+                       This is an URL to provide users for providing bug reports
+
+       config VERSION_SUPPORT_URL
+               string
+               prompt "Support URL"
+               help
+                       This an URL to provide users seeking support
+
        config VERSION_PRODUCT
                string
                prompt "Product name"