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

Yes. And also the "boot to current" works.
Only the actual partition switch to alternate seems to fail.

Weird. I can't test/debug it myself for about one more month. Can you please try the latest version (-9)? I might have narrowed the scope of two variables too much resulting in the switch partition code not running.

If you have my repo, it's just opkg update; opkg upgrade luci-mod-advanced-reboot.

Sorry, but the same result with -9
I will try to figure out which variable / if-clause behaves wrongly.

Please let me know if you do. I've tested (env-vars only) on EA8500 with reboot line commented out in lua file and it worked. I've made some changes since then tho. Once home I'll be able to test/debug on WRT3200ACM as well.

Hi @stangri,
It doesn't work for me either... I've got the latest -9 version, and have the same behavious as @hnyman

A bit off topic but, with the latest snapshot version, I've tried to install the latest linksys firmware with "sysupgrade -n -F -v linksysimage.img", and the shell kick me directly. When I reboot the router manually, I got back to the latest snapshot (??). I had to reboot to LEDE 17.01.1 and then sysupgrade and then it was ok. I don't know if somebody has the same behaviour. Is it related to to the snapshot version ?
And how to upgrade or change LEDE version without erase the other partition ?

Thanks !

That sysupgrade failure is likely the bug in 4188-4212.
See Sysupgrade bug in r4188-r4212, fixed by r4213 (NAND devices, LuCI)

@hnyman, @aqwserf I figured out what the problem was, should be fixed in -11 build.

Turns out index function loads before my variables are initialized.

1 Like

Thanks, now wrt3200acm reboots correctly to the alternative partition.

Your assessment about the reason is probably right. When I tested it, it looked like the altreboot function was not entered at all, as my debug print commands inside that function did not get triggered. But I didn't figure out that it was due to the if clause inside index function.

Ps. I think that you should change the name from "mod" to "app", i.e. "luci-app-advanced-reboot" or even "luci-app-advanced-linksys-reboot" as all the devices using that scheme are likely Linksys devices.

Most likely Linksys, yes, but infering it beeing for Linksys only could misdirect unsuspecting users about the poweroff feature, wich is commonly available on all devices.

1 Like

From what I've seen so far, it might not be too difficult to extend this luci plugin to support at least the ZyXEL NBG6817 (IPQ8065) as well, despite it using a quite different strategy for dualbooting (bootflag stored in a raw mtd, an added complexity to identify this mtd due to differing mtd partitioning schemes between OEM and LEDE device tree, kernel/ rootfs on eMMC instead of SPI-NOR, etc.).

@hnyman: thanks for the information :wink:

@stangri: works great now ! Thanks for the update

As mentioned above, on the non supported dual partition devices it should just show the Power Off button, which might still be useful. Also, with other brands starting to make dual-partition devices, would a long-term vision be a packager per brand?

Can you please elaborate a bit more on what's suitable for "luci-mod" and what is for "luci-app"?

I'm not married to any specific name for the project, just trying to figure out what's best.

@jow would know best, but my interpretation is that "modules" directory (and menuconfig menu) is for the large core modules like luci-base, luci-mod-admin-full etc., while individual add-on apps like this are in the "applications" subdir (and menu).

Thanks. I guess something else in the modules/ led me to believe otherwise. I renamed the package to luci-app-advanced-reboot.

Users with my repo need to run the following to switch: opkg remove luci-mod-advanced-reboot; opkg update; opkg install luci-app-advanced-reboot.

In build 17 I've tried to implement the two-step reboot to alternative partition and power off. Warning texts are incomplete, there're just placeholders there, however functionality should work.

Known issue: both Cancel and Proceed buttons on step 1 are treated equally. :wink:

@hnyman and all -- please provide feedback on version 19. It is feature-complete, if anything needs adjusting before I submit a PR to official repo, please post.

I will compile a test version for myself. But while extracting your sources from the -19 .ipk package, I noticed (or actually "git diff" noticed) that there are lots of white space errors (spaces before tabs). You should polish that before a PR.

I will test the -19 package later today.

I'm using Atom with its default setting for tabbing, I've noticed it sometimes inserts spaces and sometimes tabs, not sure what the recommended practice is.

The tree is here: https://github.com/stangri/openwrt-luci/tree/luci-app-advanced-reboot/applications/luci-app-advanced-reboot

Great, you just updated the Github tree. Makes much easier to suggest possible changes :wink:

(I looked a few minutes ago at the tree and there was only the early June version...)

Thanks @stangri , I'll test and report ASAP (Cisco E4200V2).