[LEDE-DEV] [PATCH v3 0/2] ar71xx: fix making firmwares for Linksys WRT400N

Yousong Zhou yszhou4tech at gmail.com
Wed Dec 28 23:26:57 PST 2016


I believe the situation at the moment for WRT400N is like this

 - factory image is broken and will brick the device because the utility
   wrt400n will truncate the kernel to 1MB.
 - sysupgrade image is missing from snapshots because the kernel size is too
   big exceeding the size limit imposed by "linux" part of mtdparts

Lifting size limits of mtdparts is easy.  I was more interested in figuring out
where did that 0x100000 and 0x2fffc4 limit for factory image come from.

Here are my finding After checking with content of OEM SDK, I believe that only
crc32sum of the whole firmware was checked and the other 2 crc32sums for kernel
and rootfs were only written to nvram without actually being checked.  However
I did find a utility named 'read_fw' using the same limit as the old wrt400n
here, but it seems that it's just a read-only utility for synthesizing a
factory from /dev/mtd{2,3}.

Maybe someone with serial console attached to this device can give the patch a
try.  Bear in mind though it may brick your device and so you MUST prepare
before hand how to do the unbrick.

Google Drive link for ready-made firmwares:

	https://drive.google.com/drive/folders/0B0ollk-mJJJAaTJmb01hb1pjejg

v3 <- v2

	- Changed from RFT to PATCH (thanks to Frank Horowitz for testing the RFT v2 version)
	- Rebased on current master (use pad-to instead of append-kernel with blocksize)
	- wrt400n: add size limit check on kernel and rootfs part as required by OEM system

v2 <- v0:

	- fix crc32 seed value for crc32sum of whole file
	- fix output file permission bits
	- fix fw_totalsize calculation
	- 0xff as the last byte of ih.magic


Yousong Zhou (2):
  tools: wrt400n: fix making factory images with kernel bigger than 1MB
  ar71xx: wrt400n: lift size limit on kernel and rootfs part

 .../ar71xx/files/arch/mips/ath79/mach-wrt400n.c    |  12 +-
 target/linux/ar71xx/image/generic.mk               |  22 +
 target/linux/ar71xx/image/legacy-devices.mk        |   5 -
 target/linux/ar71xx/image/legacy.mk                |  11 -
 tools/firmware-utils/src/wrt400n.c                 | 463 +++++++++------------
 5 files changed, 221 insertions(+), 292 deletions(-)

-- 
2.6.4




More information about the Lede-dev mailing list