Add Support for Linksys EA7300 V2

My understanding is that flashing overwrites the backup - not the booted image.

Pasted from the V1 commit page:

  If  booted  from  'A',
flashing  over  'B'  won't  work.  To  get  around  this,  you  should  flash  the
OEM  image  over  itself.  This  will  then  boot  the  router  from  'B'  and
allow  you  to  flash  OpenWRT  without  problems.

I not sure, if you are running OpenWrt on 'A', that you can reflash OpenWrt to 'B' using the OpenWrt interfaces. There may be a way to ID the 'B' partition and use mtd but I actually like having OEM as a backup.

Yes, understand your point (OEM as a backup) - it's not bad, agreed there. What has been confusing me is that my Linksys EA3500 is also dual partition, and it behaves differently => always flashes the backup (non-active) partition.

So I tried something ... updated and re-built OpenWrt, flashed it. It should flash the backup partition, as you noted - but it doesn't! Confirmed, it flashes the active (OpenWrt) partition. Then it reboots to the alternative partition (which is OEM) ... so a bit odd and confusing. I then told Linksys OEM firmware to swap back (no flash) => it did, and I can confirm, the sysupgrade was applied to the active partition, not backup.

Seems the notes need to change, or modify the code to flash the alternative partition?

Thanks!

Staying with the A/B syntax, it appears that only 'A' can be flashed with OpenWrt, I agree that it would be useful to have documentation to that effect for the multiple Linksys devices that use this scheme. If you are successful reaching the V1 committer, getting his buy-in would be nice. I previously emailed him but did not get a response.

Sure, will let you know. I can see an upside of this as well - it was just confusing me to start, given how the EA3500 works. And also a bit confusing to upgrade OpenWrt, then boot to OEM ... :laughing:.

Want to try to see if settings are saved - I have a bad feeling this won't work, as they are restored on reboot. Hmmm ... then again, they may, given how they are stored.

Thanks!

Hi,

FYI, I think I found what is "missing" (to be the same as other dual partition devices). Check out,

target/linux/kirkwood/base-files/etc/init.d/bootcount
target/linux/kirkwood/base-files/lib/upgrade/platform.sh

And then,

target/linux/mvebu/cortexa9/base-files/lib/upgrade/linksys.sh

Thoughts?

Thanks!

The v2 commit added ea7300-v2 to the bootcount and platform.sh files. See diffs of the last 2 entries in the commit.

https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=620f9c773413a0deaeda2bdc22d5e9cb89b9317f

Yes, sorry - I wasn't very clear (not even close :rofl:). I see that in the EA3500 (and some other Linksys dual partition devices), inside platform.sh, the dual platform devices call,

platform_do_upgrade_linksys "$1"

vs. other devices, that call,

nand_do_upgrade "$1"

In the EA7300v2 (the commit you mention), platform.sh calls,

nand_do_upgrade "$1"

So this needs to be updated, to match the other dual partition devices, agreed?

Thanks!

Both versions of the EA7300 have NAND flash and I was trusting the earlier commit to be accurate.

Could

platform_do_upgrade_linksys "$1"

be for NOR flash?

https://openwrt.org/docs/techref/flash.layout

Still digging! Trying to understand why it's not writing to the alternative partition. Odd, but I can't set u-boot variables, for example,

root@OpenWrt:~# fw_setenv boot_part 2
Can't open /dev/mtd1: Permission denied
Error: can't write fw_env to flash

Is this working for you?

Thanks!

Most of this is over my head but when doing pre-purchase research, I was looking at different u-boot setups. The Xiaomi Mi Router 4A thread may be helpful. I think most boot loader partitions are mounted read only. In that thread, initial access to the boot loader was gained by copying the partition, using a hex editor to change the boot delay and then using mtd to overwrite the partition. A backup of the original, unedited boot partition would be prudent.
https://forum.openwrt.org/t/xiaomi-mi-router-4a-gigabit-edition-r4ag-r4a-gigabit-fully-supported-and-flashable-with-openwrtinvasion/36685
I've seen this likened to a nuclear option and it is considered risky.

u_env needs to be writable (not read-only;) for this to work.

Yep, that's it - good catch! I confirmed, on my ea3500 (dual partition), in target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-ea3500.dts

                partition@80000 {
                        label = "u_env";
                        reg = <0x80000 0x4000>;
                };

Hmmm ... how to make it rw (not bootloader, u-env), so I can get back to this working (to be able to boot correctly).

Thanks again.

You remove the read-only; attribute (line 93) for u_env from your DTS and build OpenWrt that way (and provide a tested patch afterwards).

--
Using kmod-mtd-rw might ease up initial testing.

1 Like

Yes, sorry - I wasn't very clear. I meant because it was in the router as read-only, I wasn't sure how to get back to OEM to re-flash. I got back though with 3x power cycles, then re-flashed with read-only removed. Now I can use advanced reboot, selectively go back and forth between partitions. Perfect - thanks!

Now, to figure out why sysupgrade isn't writing to the alternative partition. Hmmm.

I have a Linksys EA7300, I did the update to OpenWRT, however in partition B it continues in OEM and every time the router is turned off and on it starts up with partition B OEM. Could you please help me.

I had similar problems and ended up doing the 3 hard resets. Since, I have been able to power-off, one time, and it booted OpenWrt.

See the commit:

https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=620f9c773413a0deaeda2bdc22d5e9cb89b9317f

I haven't understood the flashing instruction in git.
Anybody can better explain the meaning of
When flashing, OEM firmware writes over the non-booted partition. If booted from 'A', flashing over 'B' won't work. To get around this, you should flash the OEM image over itself. This will then boot the router from 'B' and allow you to flash OpenWRT without problems
I'm not sure about the sequence of operations.

FYI - I have created a devicepage for the EA7300 v2. Feel free to add any information there which could be helpfull for other users! :slight_smile:

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