openwrt/include
Adrian Schmutzler 02d6ac1060 base-files: fwtool: make compat_version backward compatible
So far, the compatibility mechanism only works if both device and
image are already updated to the new routines. This patch extends
the sysupgrade metadata and fwtool_check_image() to account for
"older" images as well:

The basic mechanism for older devices to check for image compatibility
is the supported_devices entry. This can be exploited by putting
a custom message into this variable of the metadata, so older FW
will produce a mismatch and print the message as it thinks it's the
list of supported devices. So, we have two cases:

device 1.0, image 1.0:
  The metadata will just contain supported_devices as before.

device 1.0, image 1.1:
  The metadata will contain:

  "new_supported_devices":["device_string1", "device_string2", ...],
  "supported_devices":["Image version 1.1 incompatible to device: ..."]

  If the device is "legacy", i.e. does not have the updated fwtool.sh,
  it will just fail with image check and print the content of
  supported_devices. If DEVICE_COMPAT_MESSAGE is set, this will be
  printed on old devices as well through the same mechanism. Otherwise
  a generic "Please check documentation ..." is appended.

  Upgrade can still be performed with -F like when
  SUPPORTED_DEVICES has been removed to prevent bricking.

  If the device has updated fwtool.sh (but is 1.0), it will just use
  the new_supported_devices instead, and work as intended (flashing
  with -n will work, flashing without will print the appropriate
  warning).

This mechanism should provide a fair tradeoff between simplicity
and functionality.

Since we touched a lot of fields in metadata, this also bumps
metadata_version to 1.1.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-07-31 11:40:15 +02:00
..
site
autotools.mk
cmake.mk cmake: Install host packages to lib instead of lib64 2019-12-23 00:22:07 +01:00
debug.mk
depends.mk
device_table.txt
download.mk build: add zstd support to pack/unpack functions 2020-05-31 11:03:30 +02:00
feeds.mk
hardened-ld-pie.specs
hardening.mk buildsystem: Make PIE ASLR option tristate 2020-01-13 15:34:36 +01:00
host-build.mk build: improve ccache support 2020-07-11 15:19:53 +02:00
image-commands.mk base-files: fwtool: make compat_version backward compatible 2020-07-31 11:40:15 +02:00
image-legacy.mk
image.mk build: add DEVICE_COMPAT_VERSION and DEVICE_COMPAT_MESSAGE 2020-07-31 11:40:15 +02:00
kernel-build.mk build: add 'make kernel_xconfig' command 2020-07-08 16:07:05 +02:00
kernel-defaults.mk
kernel-version.mk kernel: bump 5.4 to 5.4.52 2020-07-17 11:00:33 +02:00
kernel.mk build: move symvers files to kernel build dir 2020-04-09 09:54:02 +02:00
netfilter.mk kernel: netfilter.mk: fix kmod-ipt-nat6 installation on 5.4 2020-04-20 15:07:17 +02:00
nls.mk
package-bin.mk
package-defaults.mk toolchain: remove gcc libssp and use libc variant 2020-06-17 23:57:07 +02:00
package-dumpinfo.mk
package-ipkg.mk build: reduce number of files passed to ipk-remove 2020-07-11 13:33:28 +02:00
package-seccomp.mk
package.mk build: improve ccache support 2020-07-11 15:19:53 +02:00
prereq-build.mk build, imagebuilder: Do not require libncurses-dev 2020-06-03 16:49:28 +02:00
prereq.mk
quilt.mk
rootfs.mk
scan.awk
scan.mk
shell.sh
subdir.mk
target.mk target.mk: change i386 CPU type to pentium-mmx 2020-07-08 22:54:34 +02:00
toolchain-build.mk
toplevel.mk build: improve ccache support 2020-07-11 15:19:53 +02:00
u-boot.mk u-boot.mk: switch download to https 2020-04-26 21:20:47 +02:00
uclibc++.mk libcxx: Add package 2019-12-23 00:22:07 +01:00
unpack.mk build: add zstd support to pack/unpack functions 2020-05-31 11:03:30 +02:00
verbose.mk
version.mk