Skip to content

Commit

Permalink
config: add VERSION_FIRMWARE_URL
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: openwrt/openwrt#17780
Signed-off-by: Christian Marangi <[email protected]>
  • Loading branch information
aparcar authored and Ansuel committed Jan 30, 2025
1 parent 51b7df9 commit 17f8a19
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/version.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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'

1 change: 1 addition & 0 deletions package/base-files/files/usr/lib/os-release
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions package/base-files/image-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 17f8a19

Please sign in to comment.