config: add VERSION_FIRMWARE_URL
authorPaul Spooren <mail@aparcar.org>
Wed, 29 Jan 2025 19:09:54 +0000 (19:09 +0000)
committerChristian Marangi <ansuelsmth@gmail.com>
Thu, 30 Jan 2025 18:25:37 +0000 (19:25 +0100)
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@aparcar.org>
Link: https://github.com/openwrt/openwrt/pull/17780
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
include/version.mk
package/base-files/files/usr/lib/os-release
package/base-files/image-config.in

index 1ac29b629adb6b6eaeb18e45b853cad88b8fc6ca..e9829e860afe230dca2fd7c2833e89a5230bf740 100644 (file)
@@ -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'
-
index 12db2c0ac6668b55c2ee48809b8f35d65b419202..7682101dc348d2127f0710cf6fe3063ad7b2f823 100644 (file)
@@ -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"
index dee06e9b864b789084d11555f286d9a12f4e4109..67ef4d415a1f343e52c3f244b8904a74eacd33df 100644 (file)
@@ -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"