[openwrt/openwrt] config: add VERSION_FIRMWARE_URL

LEDE Commits lede-commits at lists.infradead.org
Thu Jan 30 10:25:47 PST 2025


ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/17f8a197f36597e13dde136b7e97ea09548921de

commit 17f8a197f36597e13dde136b7e97ea09548921de
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Wed Jan 29 19:09:54 2025 +0000

    config: add VERSION_FIRMWARE_URL
    
    This new value points to where firmware can be downloaded. It's not
    about a single release but all available firmware releases.
    
    In the next step, this URL should be exposed via `ubus call system
    board` as an entry of the `distribution` field. With that value, the
    running firmware can check for newer releases.
    
    We already have VERSION_REPO however that's different and only meant for
    package managers to download their fitting package indexes/packages.
    
    Signed-off-by: Paul Spooren <mail at aparcar.org>
    Link: https://github.com/openwrt/openwrt/pull/17780
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 include/version.mk                          | 6 +++++-
 package/base-files/files/usr/lib/os-release | 1 +
 package/base-files/image-config.in          | 6 ++++++
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/include/version.mk b/include/version.mk
index 1ac29b629a..e9829e860a 100644
--- a/include/version.mk
+++ b/include/version.mk
@@ -18,6 +18,7 @@ PKG_CONFIG_DEPENDS += \
 	CONFIG_VERSION_MANUFACTURER_URL \
 	CONFIG_VERSION_PRODUCT \
 	CONFIG_VERSION_SUPPORT_URL \
+	CONFIG_VERSION_FIRMWARE_URL \
 	CONFIG_VERSION_HWREV \
 
 sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
@@ -50,6 +51,9 @@ VERSION_HOME_URL:=$(if $(VERSION_HOME_URL),$(VERSION_HOME_URL),https://openwrt.o
 VERSION_SUPPORT_URL:=$(call qstrip,$(CONFIG_VERSION_SUPPORT_URL))
 VERSION_SUPPORT_URL:=$(if $(VERSION_SUPPORT_URL),$(VERSION_SUPPORT_URL),https://forum.openwrt.org/)
 
+VERSION_FIRMWARE_URL:=$(call qstrip,$(CONFIG_VERSION_FIRMWARE_URL))
+VERSION_FIRMWARE_URL:=$(if $(VERSION_FIRMWARE_URL),$(VERSION_FIRMWARE_URL),https://downloads.openwrt.org/)
+
 VERSION_PRODUCT:=$(call qstrip,$(CONFIG_VERSION_PRODUCT))
 VERSION_PRODUCT:=$(if $(VERSION_PRODUCT),$(VERSION_PRODUCT),Generic)
 
@@ -103,7 +107,7 @@ VERSION_SED_SCRIPT:=$(SED) 's,%U,$(call sed_escape,$(VERSION_REPO)),g' \
 	-e 's,%b,$(call sed_escape,$(VERSION_BUG_URL)),g' \
 	-e 's,%u,$(call sed_escape,$(VERSION_HOME_URL)),g' \
 	-e 's,%s,$(call sed_escape,$(VERSION_SUPPORT_URL)),g' \
+	-e 's,%f,$(call sed_escape,$(VERSION_FIRMWARE_URL)),g' \
 	-e 's,%P,$(call sed_escape,$(VERSION_PRODUCT)),g' \
 	-e 's,%h,$(call sed_escape,$(VERSION_HWREV)),g' \
 	-e 's,%B,$(call sed_escape,$(SOURCE_DATE_EPOCH)),g'
-
diff --git a/package/base-files/files/usr/lib/os-release b/package/base-files/files/usr/lib/os-release
index 12db2c0ac6..7682101dc3 100644
--- a/package/base-files/files/usr/lib/os-release
+++ b/package/base-files/files/usr/lib/os-release
@@ -7,6 +7,7 @@ VERSION_ID="%v"
 HOME_URL="%u"
 BUG_URL="%b"
 SUPPORT_URL="%s"
+FIRMWARE_URL="%f"
 BUILD_ID="%R"
 OPENWRT_BOARD="%S"
 OPENWRT_ARCH="%A"
diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in
index dee06e9b86..67ef4d415a 100644
--- a/package/base-files/image-config.in
+++ b/package/base-files/image-config.in
@@ -241,6 +241,12 @@ if VERSIONOPT
 		help
 			This an URL to provide users seeking support
 
+	config VERSION_FIRMWARE_URL
+		string
+		prompt "Firmware URL"
+		help
+			This is an URL to provide users for downloading firmware
+
 	config VERSION_PRODUCT
 		string
 		prompt "Product name"




More information about the lede-commits mailing list