openwrt/package/system
Linus Walleij 30b4b7ee09 mtd: Make fixwrgg command work on DIR-685
The D-Link DIR-685 has the same problem as the
D-Link DAP-2695: when flashing the factory image, the
checksum includes the whole flashed image, even the
rootfs_data part with the end of filesystem mark.
Also the whole flashed image is stored in the flash,
so on the first boot, the whole rootfs image is loaded
into memory with the kernel.

This is fixed using the fixwrgg command to mtd, but
for this to work we need to make fixwrgg work with
the Little-Endian ARM DIR-685.

The code tries to be endian agnostic but this fails
because the WRGG image loader doesn't. On ARM, the
file size is stored in little endian format, and on
big-endian systems it is stored in big endian format,
so we can just drop all the friendly htonl() that
will make the shdr->size big endian: this will
actually break the little endian systems, and on
the big endian systems the native endianness will
still be correct.

The magic number is always stored in little endian
format however, so make sure this is always read
in LE32 format. I chose to create a straight-forward
le32_to_cpu() static inline that IMO is simple and
easy to read.

Cc: Stijn Tintel <stijn@linux-ipv6.be>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-05-18 16:37:30 +02:00
..
ca-certificates ca-certificates: update to version 20190110 2019-03-21 00:57:54 +01:00
fstools fstools: update to the latest master branch 2019-03-28 12:57:08 +01:00
fwtool fwtool: add support for extracting the truncated data part to stdout 2019-02-12 16:41:38 +01:00
iucode-tool tools: add iucode-tool 2018-02-11 14:39:16 +01:00
mtd mtd: Make fixwrgg command work on DIR-685 2019-05-18 16:37:30 +02:00
openwrt-keyring openwrt-keyring: bundle latest usign certificates 2018-05-20 19:39:12 +02:00
opkg opkg: update to latest Git head 2019-01-31 10:23:20 +01:00
procd procd: fix compile issue 2019-05-09 18:33:39 +02:00
rpcd rpcd: update to latest Git head 2018-12-12 16:33:54 +01:00
ubox ubox: bump to git HEAD 2019-04-07 19:37:18 +03:00
ubus packages: set more explicit ABI_VERSION values 2019-01-19 14:31:51 +01:00
ucert ucert: add PROVIDES also for minimal 'ucert' package 2019-03-08 01:18:12 +01:00
uci system: uci: Use config dir on uci_add and support add_/del_list 2019-05-17 21:41:43 +02:00
usign treewide: replace LEDE_GIT with PROJECT_GIT 2018-01-10 21:27:32 +01:00
zram-swap zram-swap: bump pkg version 2018-09-29 17:23:11 +02:00