diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2019-05-15 22:37:25 +0200 |
---|---|---|
committer | Christian Lamparter <chunkeey@gmail.com> | 2019-05-18 16:37:30 +0200 |
commit | 30b4b7ee0961033ef4b25215c38fd5aa8af459bd (patch) | |
tree | 9332fc2c3c4c376aa55f56c5a635c6fead3bb133 /Makefile | |
parent | 671c9d16e382bcace441d8ad07816f8ceeed3612 (diff) | |
download | upstream-30b4b7ee0961033ef4b25215c38fd5aa8af459bd.tar.gz upstream-30b4b7ee0961033ef4b25215c38fd5aa8af459bd.tar.bz2 upstream-30b4b7ee0961033ef4b25215c38fd5aa8af459bd.zip |
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>
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions