Be careful not to try to do an OpenWRT upgrade from an old major version to a new major version. You’ll see exec format errors and the like because they changed libc vendors so everything that is dynamically linked breaks. The upgrade script won’t stop you from nearly bricking your device. Whoopsie!
We ran into this on a TP-Link TL-WR1043ND V2 while doing a farm (moo) wifi install. Unfortunately the OpenWRT bootloader failsafe code is known to be buggy, at least for these devices, so all the documented recovery options will fail. Doubly unfortunately, the advice in the old ticket system is to install a JTAG header. That’s neither quick nor within the means of most people. And not necessary in this case.
Fortunately, there’s another way. Both the ‘scp’ binary and the ‘mtd’ binary are statically linked in older versions (as is ash), so you can scp a factory firmware image from your laptop to the local storage and then
mtd write it to the
firmware target (read the mtd manpage – it’s important). After that is confirmed to be written successfully, you can reboot with a working system (back to default settings). Since ash is statically linked, remember you can
echo openwrt-21* and the like even though your ‘ls’ is broken.