Web UI to reboot to another partition (for Linksys/ZyXEL dual-partition routers) and to power off/power down

almost forgot about this, after the modification to bootcmd

and setting boot_part to 2, it booted to the second partition. going to see if i can get it to work with the webui

problem is to correctly handle the recovery thing but guess you can ignore

yeah that is the only thing, ive noticed theres the Linksys E4200v2 that has its bootcmd modified, no clue as to what it is from the factory as i do not have one, just looking at its device JSON

oh also, what is labelOffset for and how can i figure out its value?

Sorry about delay in replying. It's the offset for the partition label information (OS, linux version, etc) from the partition holding that OS. If you dump first 1Kb and view it with the hex editor, it should either be obvious or missing. :wink:

I'm curious to know if it works on an EA7300v1 since in README's supported devices it's not listed but in last (1.0.1-3) build it's json file is included. Thanks!

Yeah, if you see the json for the device listed at https://github.com/openwrt/luci/tree/master/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices (or whatever release version you're using instead of master in the tree), it should be supported.

And thanks for bringing it up, I've updated the docs with the devices which were missing.

Thank you Stangri, I'll be receiving the router in a couple days and I'm reading a lot to not brick the device installing openwrt 22.03.2. Hope in the next stable releases this whole partition selection gets better supported. Regards.-

@stangri Thanks for your excellent work!

Could support be added for Linksys EA6350v4 ?

I picked one up at Goodwill and have started tinkering :slight_smile:

I've written just the WebUI wrapper for the routers which already support booting into both partitions. There are some routers which while being dual-partition with OEM firmware only support booting from one of the partitions when flashed with OpenWrt. Unless the maintainers of these devices add support for booting OpenWrt from either partition, they can't be supported by this WebUI package.

@stangri Thanks for the clarification. I'll look into whether the Linksys EA6350v4 build already supports booting OpenWrt from either partition. If not, I will work with build maintainers to see whether that can be added.

The relevant page ( https://openwrt.org/toh/linksys/ea6350_v4 ) seems to be a bit thin on details at present. Perhaps I can also help bring the page quality, completeness up a bit.


It's usually more helpful to find the commit which enabled support of this device in the openwrt repo, commits usually contains a lot of background/support information for the device (as well as the name of the committer/maintainer).

Would it be possible to add support for Linksys EA9200? Would be glad to be of assistance if you need anything. https://openwrt.org/toh/hwdata/linksys/linksys_ea9200

There's no commit linked from the ToH article and I couldn't locate the commit where support for this device has been added. If you have this device -- how do you switch active partitions on it?

The only way I've been able to switch partitions were:

A. rebooting from Luci switches back to stock firmware
B. reflashing from from stock firmware ui leads back to OpenWrt

If there are any ways to check this properly from OpenWrt I'd be happy to follow, but right now these are the only ways I know in which the active partitions switch.

Ah, that's a bummer. Thanks a lot though!


The Xiaomi AX9000 has experimental support for OpenWRT.

It's a dual firmware router and to switch between them, just needs the commands, on OpenWRT:

fw_setenv flag_boot_rootfs=1 or 0
fw_setenv flag_last_success=1 or 0

0 means the mtd rootfs and 1 the mtd rootfs_1

Where can I find documentation for constructing its template for this package?


There's no documentation, you can refer to json files for the other devices as a reference: https://github.com/openwrt/luci/tree/master/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices

In your case the bootEnv1 should be flag_boot_rootfs with two next variables set to 0 and 1, bootEnv2 and other parameters for bootEnv2*** must be null.

The partition1MTD and partition2MTD should refer to rootfs and rootfs_1 partitions and labelOffset is how many bytes need to be skipped from the beginning of partition to find the linux kernel information text.

1 Like

Pull request submitted: https://github.com/openwrt/luci/pull/6124

Thanks. :slight_smile: