difos/target/linux/ar71xx/image
Petr Štetiar 6009b3fd58 ar71xx: ubnt-m-xw: Fix factory image flashing using TFTP recovery
This is backport of the same functionality in ath79, from commit
 d42a7c469 ("ath79: ubnt-m-xw: Fix factory image flashing using TFTP
             recovery method")

Ubiquity allows flashing of unsigned factory images via TFTP recovery
method[1]. They claim in airOS v6.0.7 release changelog[2] following:

 All future airOS versions will be signed in this way and not allow
 unsigned firmware to be loaded except via TFTP.

U-boot bootloader on M-XW devices expects factory image revision
version in specific format. On airOS v6.1.7 with `U-Boot 1.1.4-s1039
(May 24 2017 - 15:58:18)` bootloader checks if the revision major(?)
number is actually a number, but in currently generated images there's
OpenWrt text and so the check fails:

 Hit any key to stop autoboot:  0
 Setting default IP 192.168.1.20
 Starting TFTP server...
 Receiving file from 192.168.1.25:38438
 Received 4981148 bytes
 Firmware check failed! (1)

By placing arbitrary correct number first in major version, we make the
bootloader happy and we can flash factory images over TFTP again:

 Received 3801500 bytes
 Firmware Version: XW.ar934x.v6.0.4-42.OpenWrt-r9766+2-be42e44
 Setting U-Boot environment variables
 Un-Protected 1 sectors
 Erasing Flash.... done

Patch provided by AREDN[3] project, tested on Bullet M2 XW.

1. https://help.ubnt.com/hc/en-us/articles/204910124-UniFi-TFTP-Recovery-for-Bricked-Access-Points
2. https://dl.ubnt.com/firmwares/XW-fw/v6.0.7/changelog.txt
3. https://github.com/aredn

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2019-04-08 18:37:04 +02:00
..
lzma-loader ar71xx: lzma-loader: constify kernel argv array 2018-06-06 22:25:52 +02:00
common-tp-link.mk ar71xx: factor out safe loader image build code 2018-07-07 21:07:40 +02:00
generic-legacy-devices.mk mac80211: make ath10k-ct the default ath10k 2018-09-26 16:39:44 +02:00
generic-tp-link.mk ar71xx: Add support for TP-Link CPE210 v3 2019-04-02 02:09:58 +02:00
generic-ubnt.mk ar71xx: ubnt-m-xw: Fix factory image flashing using TFTP recovery 2019-04-08 18:37:04 +02:00
generic.mk build: move seama commands to image-commands.mk 2018-12-30 20:08:13 +01:00
legacy.mk ar71xx: Move F9K1115v2 under ar71xx tiny target 2018-07-16 15:12:19 +02:00
Makefile ar71xx: Move some targets to tiny 2018-10-17 18:02:16 +02:00
mikrotik.mk ar71xx: add support for MikroTik RouterBOARD 922UAGS-5HPacD 2019-03-26 18:01:47 +01:00
nand.mk mac80211: make ath10k-ct the default ath10k 2018-09-26 16:39:44 +02:00
tiny-legacy-devices.mk mac80211: make ath10k-ct the default ath10k 2018-09-26 16:39:44 +02:00
tiny-senao.mk ar71xx: move OCEDO Koala to generic and use dynamic partitioning 2018-10-29 11:21:23 +01:00
tiny-tp-link.mk Add support for TL-WA801ND v4 2018-12-07 21:46:45 +01:00
tiny.mk ath79: modify mtd partitions for Buffalo BHR-4GRV2 2018-11-26 12:28:17 +01:00
ubinize-nbg6716.ini ar71xx: nbg6716: Enable procd nand sysupgrage 2014-06-26 11:43:38 +00:00
ubinize-wndr4300.ini ar71xx: remove old jffs2 marker from image generation on nand targets 2014-06-24 18:14:18 +00:00