Linksys EA8300 stock firmware restore methods

Hello. I'm new to OpenWrt, so I have a question about how to return to stock firmware on my Linksys EA8300 if something will go wrong.
From wiki I got that only way to return back to stock firmware is "triple boot failure" method, if stock firmware sill exist on "secondary partition". But if I upgrade my OpenWrt it will overwrite that "secondary partition".

Why it is not possible just flash stock firmware image from OpenWrt GUI?

P.S. Sorry for my bad English.

Hi.
Do you have, or not, the Linksys firmware to other partition ?

I've just got my router from Ebay and it is running on stock firmware. I want to better understand the whole process and have backup plan before flashing custom firmware like OpenWrt.

Ok fine.
From Linksys, flash openWrt using factory file. You will now boot from partition 2 with Openwrt. Configure as you wish, and backup the settings.

In OpenWrt, install the package luci-app-advanced-reboot. It will allows you to select the Linksys partition 1 as boot. It's easier than the "three boot failure" switch method.

To upgrade openWrt, NEVER use a sysupgrade file: it will be flashed on partition 1, and you will lose Linksys firmware. Use advanced reboot to switch to Linksys, and than flash a FACTORY image of Openwrt. It will be stored on partition 2. Don't forget to restore your settings, and you're up.

2 Likes

Thanks for detailed instructions.
But I'm curious what will happen if I flash stock firmware from openwrt?

Best advice is do not even try it.

If you were foolish to perform a 'forced' install the linksys OEM firmware via LuCI or sysupgrade via SSH method onto the alternate partition, you'd probably brick it.

Once bricked, then you have to hope you are able use the Automatic Recovery method to get router back to a working state...
https://openwrt.org/toh/linksys/ea8300#recovery_automatic

Always switch the Linksys router to booting from Linksys OEM firmware and then install new factory image version of OpenWrt from Linksys UI, as advised by @badulesia

1 Like

I don't worry about not having stock firmware on one of the partitions anymore. It's pretty easy to copy the stock firmware to /tmp and run the command here:

2 Likes

Agreed.
You meant "NOT having" ?
As long as the other partition contains a proper OpenWrt, you will always be able to flash back Lynksys firmware. But I like to run stock firmware ... just to remember how limited it is comparing to OpenWrt :slight_smile:

One thing I forgot to mention : you will face browser cache issue after the flash, while browsing 192.168.1.1. You need to force reload.

1 Like

Yes it would appear the the instructions for reverting to stock on this device are a little misleading and would probably brick the partition. From the device page, the "kernel+rootfs+rootfs_data" partitions are clearly mtd10 and mtd12 when the command cat /sys/devices/virtual/ubi/ubi0/mtd_num will give you either 11 or 13 :man_facepalming:
The correct method to get current firmware partition would be:

echo "mtd$(($(cat /sys/devices/virtual/ubi/ubi0/mtd_num)-1))"

Booting into stock firmware and applying a factory.bin will also wipe the overlay_fs partition. Booting into stock firmware and applying a sysupgrade should be ok if the alt partition already has openwrt on it thus preserving settings and installed packages. You might need to fix opkg sources though.

cp -rf /rom/usr/lib/opkg/* /overlay/upper/usr/lib/opkg/

Update openwrt without booting to stock rom.

cd /tmp
fw="mtd$(($(cat /sys/devices/virtual/ubi/ubi0/mtd_num)-1))"
wget -O sysupgrade.bin http://downloads.openwrt.org/releases/21.02.1/targets/ipq40xx/generic/openwrt-21.02.1-ipq40xx-generic-linksys_ea8300-squashfs-sysupgrade.bin
mtd  -r write /tmp/sysupgrade.bin $fw
1 Like

I would also advise to never overwrite the stock firmware, as it is the ONLY Known Working State firmware partition.

An OpenWrt can get dysfunctional as you work on it and sysupgrading to the other partition does not guaranty a functional state.

This is the only risk free way to to never brick your router.

If you upgrade using this method you will also have to reinstall any extra packages you need to use since a factory install wipes the other partition giving you a default new install.

That is certainly something to consider while you are evaluating OpenWrt, but once you've settled and know what works- and what doesn't, you can pretty much ignore this. Just use the round-robin updating in your favour, and you'll always have the previously working (older-) OpenWrt version at your disposal, which was at least good-enough to allow you flashing the newer one you're currently running.

As the user asking the question is a beginner (no offense), I gave a basic advice.

I use a custom build already including all needed packages.

Absolutely, that was my point

I thing I have missunderstood your answer. I was at work, didn't take full time to read, and replyed too hastely. Sorry.