Sysupgrade binary structure

I have successfully modified the factory image for my WDR4300 to use 16M flash, now I am trying to modify sysupgrade as well, but there are a few things I don't understand about the file.

I see that factory and sysupgrade images are the same, but there is a self-proclaimed "fake certificate" at the end of sysupgrade: (non-ASCII characters are removed)

{  "metadata_version": "1.1", "compat_version": "1.0",   "supported_devices":["tplink,tl-wdr4300-v1","tl-wdr4300"], "version": { "dist": "OpenWrt", "version": "24.10.0", "revision": "r28427-6df0e3d02a", "target": "ath79/generic", "board": "tplink_tl-wdr4300-v1" } }
FWx0..E..#fake certificateFWx0..

I don't know what this is and if I can just paste it back at the end of my file after modification.
What is this "fake certificate"? (I guess openwrt checks if it has the correct file for the device)

I tried also figuring out the checksum using mktplinkfw but it says the checksum is invalid for the official sysupgrade file straight from the openwrt page.

Why is the sysupgrade checksum invalid?

There are some DEADC0DE markers after the end of the firmware squashfs at 0x63E000 and 0x640000(right before the fake cert). I just found that these trigger reformatting of the overlay.

I would like to replace the contents and just keep the header at the beginning and certificate at the end of the file.

  1. just build file with ~imagebuilder~ patched source tree
  2. that is only for factory images
  3. jffs erase-me marker

also you need to relocate last flash block with radio parameters.

ok, thanks. That makes things very easy.

I can just skip steps 1 and 2 because I already have a fully working factory image. I have been using the modified firmware including wireless radio without issues for the past week.

I will add the erase marker and "fake certificate" back as it is in the original release

I get "image check failed" error.
what tools can I use to correct the checksum or certificate that gets detected?

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.