wifipineapple-openwrt/tools
John Crispin 8871ec8c28 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>

Backport of r48829

git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@48848 3c298f89-4303-0410-b956-a3cf2f4a3e73
2016-03-01 08:14:48 +00:00
..
autoconf tools/autoconf: fix compile on musl hosts 2015-05-04 13:22:36 +00:00
automake automake: portability fixes 2015-03-24 13:13:01 +00:00
b43-tools b43-tools: b43-fwsquash.py: manually remove LP-PHY 16 support 2014-07-12 15:41:50 +00:00
bc bc: add download mirrors 2015-06-06 13:48:57 +00:00
bison bison: replace the yacc script with one that does not hardcode the path (fixes #20605) 2015-09-26 21:11:16 +00:00
ccache tools: remove static linking support 2015-02-06 00:00:43 +00:00
cloog [tools] cloog: update to 0.18.1 2013-12-15 21:07:32 +00:00
cmake tools: Fix cmake build on FreeBSD 10.1 2015-02-05 16:58:24 +00:00
dosfstools dosfstools: switch back to release tarballs, update patches to the latest sent upstream 2015-03-22 10:58:04 +00:00
e2fsprogs tools: remove static linking support 2015-02-06 00:00:43 +00:00
elftosb tools: remove static linking support 2015-02-06 00:00:43 +00:00
findutils tools: Fix compilation on x32 host 2014-10-25 16:57:16 +00:00
firmware-utils firmware-utils: mkfwimage: fix firmware_max_length for XM layout 2016-03-01 08:14:48 +00:00
flex tools: remove static linking support 2015-02-06 00:00:43 +00:00
flock tools: remove static linking support 2015-02-06 00:00:43 +00:00
gengetopt tools: gengetopt: Disable doc and tests builds 2015-05-22 22:33:41 +00:00
gmp gmp: disable assembly to fix build on systems that use PIE binaries 2015-06-04 21:44:52 +00:00
include tools: host/include/getline.h: fix FreeBSD 8.0+ support 2015-05-08 12:09:26 +00:00
libelf build: add the + token to any commands that can pass through the jobserver, fixes parallel build on some systems 2012-09-23 09:50:01 +00:00
libtool tools: libtool relocatable fixes 2015-01-13 10:23:44 +00:00
lzma tools: remove static linking support 2015-02-06 00:00:43 +00:00
lzma-old tools/lzma-old fix compile issues (patch from #10253) 2011-10-21 12:52:49 +00:00
m4 tools: remove static linking support 2015-02-06 00:00:43 +00:00
make-ext4fs make-ext4fs: avoid using libc internal declarations 2015-05-01 16:18:25 +00:00
missing-macros tools: remove a bunch of unused automake macros 2015-03-17 10:11:00 +00:00
mkimage mkimage: cross compile fix: pass HOST_*FLAGS in to uboot's makefile 2015-11-26 10:39:41 +00:00
mklibs tools: remove static linking support 2015-02-06 00:00:43 +00:00
mm-macros tools: add back and update mm-macros, it is required for libsigc++ 2015-03-20 11:34:47 +00:00
mpc [tools] mpc: upgrade to 1.0.2 2014-04-19 21:39:11 +00:00
mpfr tools: Fix mpfr build on FreeBSD 10.1 2015-02-05 16:58:10 +00:00
mtd-utils tools/mtd-utils: fix PKG_MIRROR_MD5SUM 2015-09-21 17:19:08 +00:00
mtools mtools: fix build errors on mac os x (#19064) 2015-02-24 06:06:12 +00:00
padjffs2 tools: remove static linking support 2015-02-06 00:00:43 +00:00
patch tools: drop circular dependency between patch and ccache, build patch without ccache (fixes #20132) 2015-07-26 13:02:35 +00:00
patch-image tools: remove static linking support 2015-02-06 00:00:43 +00:00
patchelf tools/patchelf: fix portability issue breaking mac os x builds (#18998) 2015-02-19 10:30:39 +00:00
pkg-config CC: tools/pkg-config: update to 0.29 2015-11-23 23:02:40 +00:00
ppl [tools] ppl: update to 1.1 2013-12-15 21:07:34 +00:00
qemu tools: remove static linking support 2015-02-06 00:00:43 +00:00
quilt include/download.mk: Add download mirrors for tools from GNU Savannah (bug #15184) 2014-10-08 08:01:39 +00:00
scons [tools] scons: upgrade to 2.3.1 2014-04-19 21:39:12 +00:00
sed tools/sed: fix compile on musl hosts 2015-05-04 13:22:17 +00:00
sparse sparse: add as a new package selectable from the config 2014-04-12 21:21:49 +00:00
squashfs tools: remove static linking support 2015-02-06 00:00:43 +00:00
squashfs4 tools: remove static linking support 2015-02-06 00:00:43 +00:00
sstrip tools: remove static linking support 2015-02-06 00:00:43 +00:00
upslug2 tools: remove static linking support 2015-02-06 00:00:43 +00:00
upx tools: remove static linking support 2015-02-06 00:00:43 +00:00
wrt350nv2-builder tools: remove static linking support 2015-02-06 00:00:43 +00:00
xz xz: update to version 5.2.1 2015-08-17 19:23:34 +00:00
yaffs2 tools: remove static linking support 2015-02-06 00:00:43 +00:00
Makefile tools: drop circular dependency between patch and ccache, build patch without ccache (fixes #20132) 2015-07-26 13:02:35 +00:00