You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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>
4 years ago
..
site Revert faulty tree push 5 years ago
autotools.mk autotools.mk: autoreconf: fix missing install-sh 5 years ago
cmake.mk cmake: Install host packages to lib instead of lib64 4 years ago
debug.mk include: remove trailing whitespaces 9 years ago
depends.mk build: add missing wildcard for ignoring .pkgdir in dependency checks 7 years ago
device_table.txt image: ensure that /dev/console exist in rootfs images 11 years ago
download.mk build: add zstd support to pack/unpack functions 4 years ago
feeds.mk build: suppress error output in feeds.mk 5 years ago
hardened-ld-pie.specs build: add hardened builds with PIE (ASLR) support 6 years ago
hardening.mk buildsystem: Make PIE ASLR option tristate 4 years ago
host-build.mk build: improve ccache support 4 years ago
image-commands.mk base-files: fwtool: make compat_version backward compatible 4 years ago
image-legacy.mk image: fix ar71xx legacy images 7 years ago
image.mk build: add DEVICE_COMPAT_VERSION and DEVICE_COMPAT_MESSAGE 4 years ago
kernel-build.mk build: add 'make kernel_xconfig' command 4 years ago
kernel-defaults.mk kernel-defaults: ensure SOURCE_DATE_EPOCH on /init 5 years ago
kernel-version.mk kernel: bump 5.4 to 5.4.52 4 years ago
kernel.mk build: move symvers files to kernel build dir 4 years ago
netfilter.mk kernel: netfilter.mk: fix kmod-ipt-nat6 installation on 5.4 4 years ago
nls.mk treewide: fix build depends to refer to source package names 6 years ago
package-bin.mk build: use if-then to avoid non-zero return codes in bin/ packaging code 7 years ago
package-defaults.mk toolchain: remove gcc libssp and use libc variant 4 years ago
package-dumpinfo.mk build: expose ABI version in .packageauxvars 5 years ago
package-ipkg.mk build: reduce number of files passed to ipk-remove 4 years ago
package-seccomp.mk include: add a seccomp filter install wrapper 9 years ago
package.mk build: improve ccache support 4 years ago
prereq-build.mk build, imagebuilder: Do not require libncurses-dev 4 years ago
prereq.mk build: cleanup possibly dangling Python 2 host symlink 5 years ago
quilt.mk build: Use LINUX_DIR for Kernel/Patch 5 years ago
rootfs.mk rootfs.mk: ensure all timestamp are set to SOURCE_DATE_EPOCH 5 years ago
scan.awk build: propagate override information to .packageinfo 9 years ago
scan.mk build: have scripts/feeds honor all toplevel .mk-files of a feed 5 years ago
shell.sh build: use mkhash to replace various quirky md5sum/openssl calls 7 years ago
subdir.mk build: remove GNU time dependency 6 years ago
target.mk target.mk: change i386 CPU type to pentium-mmx 4 years ago
toolchain-build.mk toolchain: Include hardening.mk for toolchain build 5 years ago
toplevel.mk build: improve ccache support 4 years ago
u-boot.mk u-boot.mk: switch download to https 4 years ago
uclibc++.mk libcxx: Add package 4 years ago
unpack.mk build: add zstd support to pack/unpack functions 4 years ago
verbose.mk include/verbose.mk: Add sc to failure message 6 years ago
version.mk version.mk: use https:// instead of http:// 5 years ago