EA7300, Dual Partition Support

Hi,

I see the EA7300 now officially supported (at least it seems to be, based on the TOH). I checked it out, but still seeing some "old" issues, somewhat captured in these posts,

So the flash did work, but it's "stuck" on a single partition, not ping-pong back and forth like seems to be the case (and intention?) for dual partition routers. I see a couple of issues - thoughts?

  1. the uboot env partition is set to read-only. With this, the needed boot flag cannot be changed, to switch partitions (this also breaks Advanced Reboot). This one is easy to fix, minor change to the dtsi file. I have that part working here already :laughing:.
  2. flashing is not trying to use the "other" (backup) partition, rather it flashes to the one currently in use. This should be done to the alternative partition ... right?

Thoughts?

Thanks!

1.Flash Latest Official firmware
2.then after reboot flash openwrt image
2.5 make sure router can access internet(from another router)

This method working for my ea7500 v2
sorry for my bad eng.

If you read the article about the EA7300 V2 carefully, you will find this important piece of advice:

This device has a dual partition layout (A/B). One partition is set as active and boots. If boot fails three times, than the “other” partition is set as active and booted, assuming it is still safe. A bootcounter (stored in the partiton S_ENV) is used for this purpose. The bootcounter has a flaw that prevents direct install of OpenWrt. Use this procedure to bypass:

  1. Flash Linksys GUI from itself. The device will now boot Linksys GUI from partition B.

  2. Flash OpenWrt with Linksys GUI, it will be installed on partition A and will boot.

You will be able to boot OpenWrt three times from partition A, until the bootcounter flaw set back partition B as bootable (with Linksys GUI). To prevent this, add this code to etc/rc.local

/rom/sbin/mtd unlock s_env
/rom/sbin/mtd erase s_env
exit 0

This code erases the S_ENV partition that contains the bootcounter. Information from this forum thread Can not install OpenWrt on Linksys EA7300 v2 - #11 by thosmos

Yes, I had seen that, thanks! Just one more for my list :laughing:. I did try a couple things yesterday, seems there are still a few issues to be addressed,

  1. Can't write to u_env. This breaks Advanced Reboot, and really ... the ability to set any U-Boot ENV variables. This is a very easy fix. I can push a PR for it, NP.
  2. Even with 1, partition switching doesn't really work. It's supposed to use boot_part (env variable), similar to the EA3500, to boot from the correct partition. Need to dig a bit here, but can likely also fix this one.
  3. With 1 and 2 working right ... then need to make sure that sysupgrade writes to the correct (alternative) partition. This is where I got stuck before, but can dig a bit more. Hoping to be able to also copy this from the EA3500 (as it does this all correctly).

And to your note about s_env -> why not run a cron job, that after being up for, for example, 30 min, clear this setting? Thoughts?

Thanks!

I'm not particularly happy with the current behavior, especially when I'm tring things that prevent OpenWRT from completing its boot sequence. And then I'm confused if I'm supposed to start by installing the Linksys firmware or if I can just reinstall OpenWRT. (IIRC it's the former.)

So if you can improve that I'm all support.

As for the best place to put the clearing of s_env, I'm at odds with my self. Especially because booting into the recovery is very easy with the EA7300. So I put the two commands in a shell script so that I can comment out the lines in rc.local and decide on a case-by-case basis what I want.

I would not use a cronjob or even better an at job to do that as I tend to forget about their existence...

/etc/rc.local is supposed to run on each boot and to do so it needs to be executable. On my install of 21.02.0 release, the script was not executable.

chmod +x /etc/rc.local

to fix.

Will do what I can! I had this working locally 6 months or so back (or more, can't recall exactly), but I was blocked by a bug in the 5.4 kernel. But now, on 5.10 :smile:.

First PR submitted - it's needed to allow the u-boot env to be updated from within OpenWrt.

Thanks!

I suppose you are referring to making use of the secondary OS partitions, i.e. alt_kernel and alt_rootfs.
For my more moderate requirements, the EA7300 works with stock 21.02.2:

root@routergnome:~# uname -r
5.4.179
root@routergnome:~# cat /etc/openwrt_release
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='21.02.2'
DISTRIB_REVISION='r16495-bf0c965af0'
DISTRIB_TARGET='ramips/mt7621'
DISTRIB_ARCH='mipsel_24kc'
DISTRIB_DESCRIPTION='OpenWrt 21.02.2 r16495-bf0c965af0'
DISTRIB_TAINTS=''

Yes, agreed! If single partition is OK, this build does work - agree with you.

OK, making progress here - but I do see quite a delta between the U-Boot environment on the EA7300, and my (working, dual boot) EA3500. I don't think I broke / messed up my EA7300 U-Boot env, but to confirm - do you mind sharing / pasting your U-Boot env (x-out any thing you think is "private" ... not after that!). Thanks!

Hi.
I'm the one that wrote the article. Informations come from various sources I gathered when trying to make a Ea7300 running a few months ago.
clearing s_env partition disble the advanced reboot. But that was the only solution I could find. The issue is in the bootloader, and flashing openwrt can't solve this.
If you find any new method I'm interested.

At least in terms of dual boot - I'm pretty sure I have it figured out here now. Just trying to understand if the contents of the u_env partition include the needed info or not. For example, on the EA3500 (also Linksys dual boot), I see,

nandboot=nand read.e 0x2000000 0x200000 0x300000; setenv bootargs $(console) $(mtdparts) $(fs_bootargs_root) serial_number=$(sn) uuid=$(uuid) hw_version=$(hw) device_mac=$(mac) factory_date=$(date) wps_pin=$(wps); bootm 0x2000000;
altnandboot=nand read.e 0x2000000 0x1600000 0x300000; setenv bootargs $(console) $(mtdparts) $(alt_fs_bootargs_root) serial_number=$(sn) uuid=$(uuid) hw_version=$(hw) device_mac=$(mac) factory_date=$(date) wps_pin=$(wps); bootm 0x2000000;

So then the sysupgrade script can target a boot partition. I don't see this on my EA7300, but I perhaps broke that myself ... LOL. That's why I'm looking to find a stock u_env partition for the EA7300 ... to know if I need to restore things, or set them up. Either isn't too bad, just not sure which one I need to do.

Thanks!

Get back to Linksys firmware, and flash it again. You will have both partitions with Linksys. Than switch to the other using the hardware switch method. Reboot several times. Than check infos into s_env partition.

Hi,

I'm after the u_env partition, not s_env :smile: Trying to see if nandboot and altnandboot are configured by default or not.

Thanks!

OK, figured out how to get this all working - or at least very close :laughing:. Still trying to figure out nandboot vs. altnandboot, but thinking that needs to be set up (minor). I am able to flip between partitions, the only odd thing I'm seeing right now is that on the "2nd" side I get this odd error,

[    4.003134] UBIFS error (ubi0:0 pid 1): ubifs_mount: cannot mount read-write - read-only media
[   11.864385] UBIFS error (ubi0:1 pid 432): ubifs_mount: too few LEBs (9), min. is 17
[   11.880904] mount_root: failed to mount -t ubifs /dev/ubi0_1 /tmp/overlay: Invalid argument
[   11.898062] mount_root: overlay filesystem has not been fully initialized yet
[   11.912946] mount_root: switching to ubifs overlay
[   11.922719] mount_root: switching to ubifs failed - fallback to ramoverlay

Seen that one before? Not quite sure yet how to correct it - thinking it's due to all the messing around I've been doing, a one time fix.

Thanks!

Oups, my bad !

Keep searching, I'm interested in everything new.
Thanks.

Found it! It hit me, so I checked the dtsi file => "2nd" side (dual partition router) ... was set to read-only! Fixed it here, works fine now :smile:. So I think I have all the steps figured out now, to be able to get it fully working as dual partition, like the other Linksys routers that support this.

Just one minor thing left - wanting to confirm the environment variables on another router (in case I have messed mine up with all the fooling with it). Just need someone to provide their environment settings (private info removed of course!), to check it. I'm not seeing nandboot and altnandboot on mine ... easy to adapt, if needed.

Thanks.

Ok I keep this in mind. I don't own this model, it's in a relative's home. So I'll check next time I'll go.
Thanks anyhow.

1 Like

NP, and no panic. The env settings are pretty minor, just allows "auto" switching between partitions.

Thanks!