What is the fundamental difference between tftp-recovery.bin and sysupgrade.bin?

I compared these 2 files (on different devices) and they are almost the same in all. The only difference is that tftp-recovery.bin has zeros before 0x20000 in the beginning (space for bootloader U-Boot), and sysupgrade.bin starts from 0x20000.
Also in sysupgrade.bin a little more than 300 bytes are added at the end where metadata (version, devices, revision and so on) is stored.

So what is the difference and why do we need sysupgrade.bin which is almost exactly the same as tftp-recovery.bin?

I am asking, because in the process of learning OpenWRT, many instructions say that you should first apply one firmware (via tftp), and then upgrade the system using the second firmware (sysupgrade). And if they are almost identical, why apply the second firmware?

this isn‘t a generic rule for all supported devices, but for some of them. Best is, if you also mention your particular device.

  1. In general, basically all devices have a vendor specific regular web GUI for applying vendor-specific firmware. This can be used as long as the vendor-firmware is still on the device.
  2. Most routers also have an additional so called recovery GUI for applying vendor-specific firmware. There are different variants for the reduced recovery GUI, depending on the device, but the common part of that is that the recovery GUI comes from a bootable mini OS from the boot loader of the router, not from the regular vendor firmware partition.
  3. Then there is sysupgrade, which is for the „vendor specific“ regular web flash GUI of OpenWRT, if OpenWRT was already on the device

Depending on the router and start situation, you need to use the right one of the 3 variants for flashing and depending on the device each variant may require different headers in the image for being accepted as image. Thats why there are often different variants to download.

to top that, there are a few exotic installation steps that cannot be performed by all of the 3 variants. So you may bump into routers which for the very first OpenWRT flash update need a combo of 2 different flash process variants with a noticably almost identical image, to ensure all required installation steps are covered.

I have looked at several OpenWRT firmware for TP-Link routers (841, 842, 850 and similar ). The only purpose of sysupgrade.bin firmware that comes to my mind is to upgrade from under OpenWRT if a new firmware version is released. Using sysupgrade.bin after tftp-recovery.bin firmware via tftp makes no sense (as recommended in various instructions during the initial installation of OpenWRT)

This depends on the device. Though with a WR841 or similar you can just recover and use that directly, in other cases the recovery or factory image is not a complete ready to use install because it does not permanently store settings to a flash filesystem. In those cases it is necessary to boot recovery only to use it to sysupgrade before using the router.

Always consult the device page and / or git commit for specific install instructions.

1 Like