openwrt-pf/tools/firmware-utils/src
Felix Fietkau 076d58d344 firmware-utils: mkfwimage: fix firmware_max_length for XM layout
The new u-boot version bundled with the 5.6.x firmwares from Ubiquiti gets
confused by the smaller rootfs partition size; this can lead to various
issues:

1. We've gotten reports that flashing from the 5.6.x stock firmware to
   OpenWrt will brick devices; I wasn't able to reproduce this myself
2. Flashing from 5.5.x stock firmware to OpenWrt and back to stock (via
   TFTP recovery), following by an update to 5.6.x via web interface can
   yield a bricked device with the following properties:
   - It can't be booted without entering commands over a serial console, as
     u-boot supplies the wrong MTD layout
   - The web interface won't accept any image with the original flash
     layout, so stock firmware upgrades are impossible
   - As the TFTP recovery doesn't update u-boot, returning to the old
     u-boot from firmware 5.5.x is impossible

To recover from 2., creating an OpenWrt image which doesn't set u-boot as
read-only and flashing a backup of the old u-boot from there is the only
way known to me. (Fixing the mtdparts variable in u-boot-env from OpenWrt
might also work; settings this from u-boot over serial didn't have
any permanent effect.)

Fix all of this by setting the correct flash layout also used by the stock
firmware. Flashing has been tested from both firmware 5.5.x and 5.6.x. The
fixed layout also matches the mtdparts defined by OpenWrt.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>

SVN-Revision: 48829
2016-02-29 20:11:33 +00:00
..
add_header.c
addpattern.c
airlink.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
asustrx.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
bcm_tag.h
bcmalgo.c
bcmalgo.h
buffalo-enc.c firmware-utils/buffalo-enc: add support for decrypting data with an offset 2015-10-12 13:11:03 +00:00
buffalo-lib.c firmware-utils/buffalo-enc: explicitly use signed char for checksum function 2015-10-12 13:11:20 +00:00
buffalo-lib.h
buffalo-tag.c
buffalo-tftp.c
csysimg.h
cyg_crc.h
cyg_crc16.c
cyg_crc32.c
dgfirmware.c firmware-utils: fix various compiler warnings 2015-12-11 15:09:30 +00:00
dgn3500sum.c
edimax_fw_header.c
encode_crc.c
fix-u-media-header.c
fw.h
hcsmakeimage.c
imagetag.c brcm63xx: work around boot failures with squashfs on BCM6368 2015-11-04 11:33:22 +00:00
imagetag.ggo
imagetag_cmdline.c
imagetag_cmdline.h
lzma2eva.c firmware-utils: fix various compiler warnings 2015-12-11 15:09:30 +00:00
makeamitbin.c
md5.c
md5.h
mkbrncmdline.c
mkbrnimg.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
mkcameofw.c
mkcasfw.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
mkchkimg.c
mkcsysimg.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
mkdapimg.c
mkdcs932.c
mkdniimg.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
mkedimaximg.c
mkfwimage.c firmware-utils: mkfwimage: fix firmware_max_length for XM layout 2016-02-29 20:11:33 +00:00
mkfwimage2.c firmware-utils: allow mkfwimage2 to use - in partition names 2015-12-23 14:43:47 +00:00
mkheader_gemtek.c
mkhilinkfw.c firmware-utils: fix various compiler warnings 2015-12-11 15:09:30 +00:00
mkmerakifw.c firmware-utils mkmerakifw: firmware generator for MR18 2015-12-11 15:06:45 +00:00
mkmylofw.c
mkplanexfw.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
mkporayfw.c
mkrtn56uimg.c
mksenaofw.c
mktitanimg.c
mktitanimg.h
mktplinkfw.c ar71xx: Added support for TL-WA801NDv3 2016-02-12 08:30:28 +00:00
mktplinkfw2.c lantiq: add support for TP-Link VR200v 2016-01-18 20:40:03 +00:00
mkwrgimg.c
mkzcfw.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
mkzynfw.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
motorola-bin.c
myloader.h
nand_ecc.c
osbridge-crc.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
oseama.c firmware-utils: add oseama tool for creating Seama entities 2016-02-01 12:42:00 +00:00
pc1crypt.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
ptgen.c firmware-tools/ptgen: use stdint types for struct pte 2015-06-14 17:41:21 +00:00
seama.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
seama.h
sha1.c
sha1.h
spw303v.c firmware-utils: fix various compiler warnings 2015-12-11 15:09:30 +00:00
srec2bin.c firmware-utils: fix various compiler warnings 2015-12-11 15:09:30 +00:00
tplink-safeloader.c tools/firmware-utils: tplink-safeloader: add version 1.1 support to CPE210/220/510/520 2015-10-19 10:08:50 +00:00
trx.c
trx2edips.c
trx2usr.c
wrt400n.c firmware-utils: fix various compiler warnings 2015-12-11 15:09:30 +00:00
xorimage.c
zynos.h
zyxbcm.c firmware-utils: fix various compiler warnings 2015-12-11 15:09:30 +00:00