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>
(cherry picked from commit d5035f0d26)
This commit is contained in:
Michael Pratt
2021-02-12 18:19:10 -05:00
committed by Petr Štetiar
parent 642c88714c
commit e823fb1763
9 changed files with 157 additions and 4 deletions

View File

@@ -56,7 +56,6 @@
partition@a0000 {
label = "loader";
reg = <0xa0000 0x1000>;
read-only;
};
fwconcat1: partition@a1000 {

View File

@@ -56,7 +56,6 @@
partition@a0000 {
label = "loader";
reg = <0xa0000 0x10000>;
read-only;
};
fwconcat1: partition@b0000 {

View File

@@ -60,7 +60,6 @@
partition@a0000 {
label = "loader";
reg = <0x0a0000 0x010000>;
read-only;
};
fwconcat1: partition@b0000 {

View File

@@ -58,7 +58,6 @@
partition@a0000 {
label = "loader";
reg = <0x0a0000 0x010000>;
read-only;
};
fwconcat1: partition@b0000 {