Revisting this topic because I was playing with this device again recently. It is not quite as straightforward as I had described earlier, so some new findings:
- The two boot partitions are 0 and 1. (not 1 and 2).
- The TFTP firmware installation method appears to always install into boot partition 1.
- The vendor firmware will remain in partition 0 when you install via TFTP
- OpenWrt doesn't appear to support the dual-boot nature of this device, so when you install via TFTP into partition 1 (and then install again over OpenWrt), it simply writes to partition 1 again, leaving the vendor firmware in place.
- The vendor firmware will not accept the OpenWrt image, so you can't start with the vendor firmware running out of partition 1 and then flash into partition 0.
- OpenWrt doesn't know to set the
partialboots
back to zero, so after the maxpartialboots
value is exceeded (3 by default), the firmware will roll back to slot 0 and run the vendor firmware.
- It appeared that using the
Restore previous firmware
button didn't actually return my unit to partition 1, as it would continue to boot the vendor firmware..
So... how to get around this... there are a few options:
- Live with the vendor firmware living in partition 0. This means we need to deal with the
partialboots
issue.
- Use DD-WRT (yes, that one) because DD-WRT does indeed understand the dual-boot nature of this device and will perform tick-tock upgrades. So we can leverage this to bypass OpenWrt's lack of awareness of the second partition in this device. There will still be some complications, so keep reading.
DD-WRT will also not be accepted by the vendor firmware web UI. But, you can load it via tftp. This places DD-WRT into slot 1. Once this has been done, you can flash it again (this time using the DD-WRT web UI to flash DD-WRT again), and this will flash DD-WRT into slot 0. Now DD-WRT is on both partitions.
Next, we can connect via ssh to DD-WRT (you do need to enable this first). You can use the same nvram commands as described earlier.
nvram show | grep boot
nvram set bootpartition=1
nvram commit
This will now boot DD-WRT from slot 1. And here is the magic...
DD-WRT accepts the OpenWrt image (tested with 23.05.0), and it will write it to slot 0 and then boot from there.
Now, we can easily install OpenWrt into slot 1 using the TFTP method.
And bingo! We now have OpenWrt installed on both partitions.
They will be unique installations, though -- each one will have its own configuration and packages, although it would certainly be possible to simply make a backup of one, switch partitions (manually) and restore to the other (and also install any additional packages, too).
Now, we still have one more issue... the fact that OpenWrt doesn't know about resetting the partialboots
parameter. We can handle this in two ways:
- Reset
partialboots
upon each successful boot cycle
- we can achieve this by adding the following into
/etc/rc.local
nvram set partialboots=0
nvram commit
- set
maxpartialboots
to 0
- this will effectively prevent the failover mechanism of the device, thus requiring a manual operation to switch partitions.
- this also means that there is no automatic recovery from a faulty firmware/configuation. Your device will brick if something goes wrong, likely requiring a serial connection to recover.
- I tested booting from partition 0 and then using TFTP to flash (which goes into partition 1) -- the system still booted from partition 0.
- With this in mind, if you go this route, it is probably best to only disable the failover mechanism if you are only using partition 1 -- this way, you can at least guarantee that the device will attempt to boot from anything that is freshly loaded into slot 1 via TFTP.
- To achieve this failover disable method:
nvram set maxpartialboots=0
nvram set partialboots=0
nvram set bootpartition=1 # optional, but recommended
nvram commit
reboot
- Alternatively, you could set the
maxpartialboots
to a very large number with the assumption that you won't have the device rebooting that frequently (but don't underestimate the effect that a power outage can have -- sometimes there can be many up/down cycles as power is restored, not to mention complex configuration troubleshooting and the like). At least you'd know you can boot into the other partition and change it back via the nvram settings, though.
Finally, please remember that this device isn't really a good match for OpenWrt, at least if you are using wireless. The wifi is not properly supported on this device, so you'll be very unhappy. Stick to vendor firmware or DD-WRT if you want good wifi from the EA6300. For other things, OpenWrt can be a totally reasonable choice, but be prepared with all the caveats presented here.