Ver código fonte

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 <[email protected]>
Michael Pratt 4 anos atrás
pai
commit
07723492e9
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      target/linux/ath79/image/common-senao.mk

+ 3 - 1
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 [email protected] && \
 	touch [email protected]/failsafe.bin && \
+	touch [email protected]/FWINFO-$(word 1,$(1))-$(REVISION) && \
 	echo '#!/bin/sh' > [email protected]/before-upgrade.sh && \
+	echo ': > /tmp/sysupgrade.tgz' >> [email protected]/before-upgrade.sh && \
 	echo ': > /tmp/_sys/sysupgrade.tgz' >> [email protected]/before-upgrade.sh && \
 	echo -n $$(( $$(cat $@ | wc -c) / 4096 * 4096 )) > [email protected] && \
 	dd if=$@ bs=$$(cat [email protected]) count=1 | md5sum - | cut -d ' ' -f 1 > [email protected] && \