TP-Link Archer C2 device page suggesting to install factory image from recovery

Hi,

I have noticed that the device page for TP-Link Archer C2 suggests to use the following steps to install OpenWRT:

  1. Perform a TFTP flashing of an unofficial "recovery" image, which installs some older version of OpenWRT and then
  2. from within the newly flashed, older, "recovery" version of OpenWRT, flash the current version of OpenWRT "via web interface" (which, I assume, means to use the regular upgrade procedure either via LuCi or via the sysupgrade command). However, the guide suggests to use the factory image (which, I believe, refers to squashfs-factory image) for this flashing.

I would like to ask if the instruction to use the squashfs-factory image for flashing from the existing OpenWRT installation is correct in this particular case, for this particular device. If yes, can someone explain why it is safe to do so? And also add that explanation also to the device page? If no, can this instruction be corrected?

Also, I would like to ask about the general usability of squashfs-factory images for flashing via standard means (i.e. from the LuCi web interface or by using the sysupgrade command) from within an existing OpenWRT installation. Is that supposed to typically work?

Thank you.

Factory images are meant to be used when you're still on the manufacturer's firmware, or when you're resorting to TFTP.

Once on OpenWrt, if the platform allows it, and when sysupgrade images are available, one should just use sysupgrade with those images to upgrade, even when switching between OpenWrt stable releases and master builds. You might want to use -n ('do not keep settings') in some cases though (e.g. with DSA now being introduced into master).

Yes, I am aware of the general guidelines which state that squashfs-factory images are supposed to be used when upgrading from the stock firmware, while squashfs-sysupgrade images are supposed to be used when upgrading from OpenWRT firmware.

My questions were:

  1. Is the above mentioned instruction to use squashfs-factory image while upgrading TP-Link Archer C2 from a "recovery" version of OpenWRT correct?
  2. In general, is it possible to use squashfs-factory images when upgrading from an OpenWRT firmware?

It might be, but that doesn't mean it's the right and sound way to perform an upgrade. Much to the contrary: it's not. So if it works, you just get lucky. The factory images usually contain additional logic for migration from stock to OpenWrt.

I've seen people talk that gibberish before, and maintain that using the factory images with sysupgrade works just fine. Just because you can drive on the wrong side of the road without getting into an accident doesn't mean all is good either.

As for the unofficial image, I can't say, but it does sound weird. The fact OpenWrt provides a factory image at this point would suggest you do not need that intermediary, unofficial image. I have quite a few MediaTek MIPS devices myself (mt7621, not mt7620) and I haven't needed anything like that ever. They also all have a decent recovery webserver running on http://192.168.0.1 when you put them into recovery mode (I cannot vouch for MT7620 devices).

My suggestion would be to flash the official factory image through TFTP and see where that gets you (I find TFTP to be a pretty foolproof way to recover if something goes wrong).

In this particular case, the device page states that the TFTP flashing procedure overwrites the U-Boot bootloader. Therefore, it needs to be included in the image used for this type of flashing. Also, this older post mentions that using an "ordinary firmware" for flashing via TFTP results in bricking the device. I am not sure if it refers to the stock firmware or to the OpenWRT firmware.

I do not know whether the regular OpenWRT squashfs-factory image for this device includes the correct U-Boot bootloader. If it does, I do not know if it is present at the correct offset within that image, so that it would be suitable for TFTP flashing.

When in doubt, you should trace the git commit. For newer device support (since the LEDE fork) developers are asked to add the installation procedure to the git commit, as well as the hardware details.

So it looks like it's still necessary:

Preparing a TFTP recovery image for initial flashing:

Currently the only method to install openwrt for the first time is via
TFTP download in u-boot. After first install you can use regular updates.
WARNING: This method also overwrites the bootloader partition!

Edit: I've rearranged the wiki page to make it more clear that the whole thing is really required, and linked to the git commit. The page was a hodgepodge of 'do this then that' and 'oh someone else has found this', at least now it's a bit streamlined.

1 Like

Thank you for clearing up the device's page. It is now, at least in my opinion, much simpler to understand. Notably this part:

From here on out, you can simply use sysupgrade with the vanilla OpenWrt images to upgrade.

now clearly states that the sysupgrade images need to be used for further upgrades. That is how I have done it on TP-Link Archer C2 and I can confirm that it works well.

1 Like

Happy to help!

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