openwrt/package/base-files/files/lib/functions
Adrian Schmutzler 735de53b2a base-files: add support for compat_version on device
We regularly encounter the situation that devices are subject to
changes that will make them incompatible to previous versions.
Removing SUPPORTED_DEVICES will not really be helpful in most of these
cases, as this only helps after a rename.

To solve this situation, this patchset introduces a compatibility
version for devices. To complement the DEVICE_COMPAT_VERSION set
for the image to be flashed, this implements a compat_version on
the device, so it will have something to compare with the image.

The only viable way to achieve this seems to be via board.d files,
i.e. this is technically adding a compat version for the device's
config.

Like for the network setup, this will set up a command
ucidef_set_compat_version to set the compat_version in board.d.
This will then add a string to /etc/board.json, which will be
translated into uci system config by bin/config_generate.
By this, the compat_version, being a version of the config, will
also be exposed to the user.

As with DEVICE_COMPAT_VERSION, missing uci entry will be assumed
as compat_version "1.0", so we only need to add this if a device
needs to be bumped, e.g.

   ucidef_set_compat_version "1.1"

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-07-31 11:40:15 +02:00
..
caldata.sh package/base-files: caldata: work around dd's limitation 2020-05-28 11:22:22 +02:00
leds.sh base-files: diag: restore default trigger for 'boot' LED 2020-02-24 23:27:50 +01:00
migrations.sh base-files: add leds migration 2019-04-06 19:14:05 +02:00
network.sh base-files: add network_get_uptime() to /lib/functions/network.sh 2019-06-29 21:00:58 +02:00
preinit.sh base-files: fix ramoverlay function with kernels 3.18+ 2015-09-21 17:41:07 +00:00
service.sh base-files: remove function service_kill 2014-06-02 12:43:10 +00:00
system.sh base-files: add function for generating random MAC 2020-07-28 15:52:44 +02:00
uci-defaults.sh base-files: add support for compat_version on device 2020-07-31 11:40:15 +02:00