aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79/image
diff options
context:
space:
mode:
authorMichael Pratt <mcpratt@pm.me>2021-02-12 18:19:10 -0500
committerPetr Štetiar <ynezz@true.cz>2021-04-08 09:20:59 +0200
commitd5035f0d2694cb9c5a93ed72e3b6d2dd1770741e (patch)
tree5e7bc1b5592ab32579cd622930b68837c31b4a2f /target/linux/ath79/image
parenta58cb22bbe4bac17e7421a0ad6bf7929fcd56599 (diff)
downloadupstream-d5035f0d2694cb9c5a93ed72e3b6d2dd1770741e.tar.gz
upstream-d5035f0d2694cb9c5a93ed72e3b6d2dd1770741e.tar.bz2
upstream-d5035f0d2694cb9c5a93ed72e3b6d2dd1770741e.zip
ath79: add Senao 'failsafe' sysupgrade procedure
Use a similar upgrade method for sysupgrade.bin, like factory.bin, for Senao boards with the tar.gz OEM upgrade platform, and 'failsafe' image which is loaded on checksum failure. This is inspired by the OEM upgrade script /etc/fwupgrade.sh and the existing platforms for dual-boot Senao boards. Previously, if the real kernel was damaged or missing the only way to recover was with UART serial console, because the OKLI lzma-loader is programmed to halt. uboot did not detect cases where kernel or rootfs is damaged and boots OKLI instead of the failsafe image, because the checksums stored in uboot environment did not include the real kernel and rootfs space. Now, the stored checksums include the space for both the lzma-loader, kernel, and rootfs. Therefore, these boards are now practically unbrickable. Also, the factory.bin and sysupgrade.bin are now the same, except for image metadata. This allows for flashing OEM image directly from openwrt as well as flashing openwrt image directly from OEM. Make 'loader' partition writable so that it can be updated during a sysupgrade. tested with ENS202EXT v1 EAP1200H EAP350 v1 EAP600 ECB350 v1 ECB600 ENH202 v1 Signed-off-by: Michael Pratt <mcpratt@pm.me>
Diffstat (limited to 'target/linux/ath79/image')
-rw-r--r--target/linux/ath79/image/common-senao.mk1
1 files changed, 1 insertions, 0 deletions
diff --git a/target/linux/ath79/image/common-senao.mk b/target/linux/ath79/image/common-senao.mk
index 9b5903d8e7..6784cf9aae 100644
--- a/target/linux/ath79/image/common-senao.mk
+++ b/target/linux/ath79/image/common-senao.mk
@@ -36,4 +36,5 @@ define Device/senao_loader_okli
IMAGES += factory.bin
IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \
check-size | senao-tar-gz $$$$(SENAO_IMGNAME)
+ IMAGE/sysupgrade.bin := $$(IMAGE/factory.bin) | append-metadata
endef