diff options
author | Felix Fietkau <nbd@openwrt.org> | 2016-02-29 20:11:33 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2016-02-29 20:11:33 +0000 |
commit | 076d58d3440f382c536ea8874f58b0df23c263bc (patch) | |
tree | fb10837a5b3e15f4e030d021e49ad291c653698b /tools | |
parent | 619a58d641cd763c00be42d5c99c6a72074e845c (diff) | |
download | mtk-20170518-076d58d3440f382c536ea8874f58b0df23c263bc.zip mtk-20170518-076d58d3440f382c536ea8874f58b0df23c263bc.tar.gz mtk-20170518-076d58d3440f382c536ea8874f58b0df23c263bc.tar.bz2 |
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
Diffstat (limited to 'tools')
-rw-r--r-- | tools/firmware-utils/src/mkfwimage.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c index 5dae284..d8d5239 100644 --- a/tools/firmware-utils/src/mkfwimage.c +++ b/tools/firmware-utils/src/mkfwimage.c @@ -79,7 +79,7 @@ fw_layout_t fw_layout_data[] = { .name = "XM", .kern_start = 0x9f050000, .kern_entry = 0x80002000, - .firmware_max_length= 0x006A0000, + .firmware_max_length= 0x00760000, }, { .name = "UBDEV01", |