diff options
author | Michael Pratt <mcpratt@pm.me> | 2021-03-17 19:07:46 -0400 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2022-03-13 19:54:57 +0100 |
commit | 07723492e9acf5aea51eb8de3bcc4e36305c9e6b (patch) | |
tree | 278137aae14e36433db2fe8c2b3c441ee702f6a9 /target/linux/ath79 | |
parent | e83ab243bef6e32c1fbb8ceda5301aa21f0c51cf (diff) | |
download | upstream-07723492e9acf5aea51eb8de3bcc4e36305c9e6b.tar.gz upstream-07723492e9acf5aea51eb8de3bcc4e36305c9e6b.tar.bz2 upstream-07723492e9acf5aea51eb8de3bcc4e36305c9e6b.zip |
ath79: improve factory.bin for some Senao devices
Some boards with firmware made with Senao SDK based on Linux 3.3
have the following lines in the OEM upgrade script at
/etc/fwupgrade.sh
local append=""
local CONF_TAR="/tmp/sysupgrade.tgz"
[ -f "$CONF_TAR" ] && append="-j $CONF_TAR"
and
\# check FWINFO filename
[ -z $(ls FWINFO* | grep -i ${modelname}) ] && errcode="1"
This addition also prevents needing to factory reset after flashing
for some boards that also have these lines in the script
\# Support downgrade but do default (Smart v2.x.x.x -> senaowrt v1.x.x.x)
[ $(ls FWINFO* | grep -i ${modelname} | cut -d "-" -f4 | cut -c 2) -lt 2 ] && append=""
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Diffstat (limited to 'target/linux/ath79')
-rw-r--r-- | target/linux/ath79/image/common-senao.mk | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/target/linux/ath79/image/common-senao.mk b/target/linux/ath79/image/common-senao.mk index c9c14944c4..dda7da6776 100644 --- a/target/linux/ath79/image/common-senao.mk +++ b/target/linux/ath79/image/common-senao.mk @@ -1,6 +1,6 @@ DEVICE_VARS += SENAO_IMGNAME -# This needs to make /tmp/_sys/sysupgrade.tgz an empty file prior to +# This needs to make OEM config archive 'sysupgrade.tgz' an empty file prior to OEM # sysupgrade, as otherwise it will implant the old configuration from # OEM firmware when writing rootfs from factory.bin # rootfs size and checksum is taken from a squashfs header @@ -9,7 +9,9 @@ define Build/senao-tar-gz -[ -f "$@" ] && \ mkdir -p $@.tmp && \ touch $@.tmp/failsafe.bin && \ + touch $@.tmp/FWINFO-$(word 1,$(1))-$(REVISION) && \ echo '#!/bin/sh' > $@.tmp/before-upgrade.sh && \ + echo ': > /tmp/sysupgrade.tgz' >> $@.tmp/before-upgrade.sh && \ echo ': > /tmp/_sys/sysupgrade.tgz' >> $@.tmp/before-upgrade.sh && \ echo -n $$(( $$(cat $@ | wc -c) / 4096 * 4096 )) > $@.len && \ dd if=$@ bs=$$(cat $@.len) count=1 | md5sum - | cut -d ' ' -f 1 > $@.md5 && \ |