Files
openwrt/scripts
Johan Alvarado b5a84a3323 scripts: add Mercusys fwup image generator
Mercusys devices whose stock web UI expects an fwup container reject the
tplink-image-2022 container: the loader picks its verification algorithm
from the fw-type string at offset 0x14, which that container does not
write.

Build the container the loader accepts, with the fw-type string, the
support list and the MD5 placeholder digest in place.

This is a separate script rather than a flag on tplink-mkimage-2022.py
because only the first 0x14 bytes match, the BE length and the salted MD5
over file[4:]. That script writes 0xff filler up to 0x1014, a table there
(>2I rootfs_size/num_items, then >I32s2I entries), data at a fixed 0x1814
base, the rootfs first and a packed >4B1I2I soft version. The fwup
container has no table: 0x2c records of name[32] + >III base, next_off,
size, each followed by its own data and chained through next_off until 0,
the rootfs appended after the last record, and the soft version as ASCII
soft_ver: in an ordinary record.

Signed-off-by: Johan Alvarado <contact@c127.dev>
Link: https://github.com/openwrt/openwrt/pull/24919
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-02 11:09:30 +02:00
..
…
…
…
…
…
…
…