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

Finally, got spare time to test on my Cisco e4200v2:

1 Like

@jow @stangri
I tried installing the advanced reboot package, but opkg gives an error:

# wget https://github.com/stangri/openwrt-repo/blob/master/luci-mod-advanced-reboot_git-17.080.69173-773734e27-7_all.ipk
# opkg install luci-mod-advanced-reboot_git-17.080.69173-773734e27-7_all.ipk
Collected errors:
 * pkg_init_from_file: Malformed package file luci-mod-advanced-reboot_git-17.080.69173-773734e27-7_all.ipk.

Not sure if that is due to the package contents or opkg. Opening the package file manually shows its contents properly, so that makes me wonder about opkg.

When you do wget https://github.com/stangri/openwrt-repo/blob/master/luci-mod-advanced-reboot_git-17.080.69173-773734e27-7_all.ipk it downloads an HTML file instead of the ipk. I've done the same and tested with head luci-mod-advanced-reboot_git-17.080.69173-773734e27-7_all.ipk.

Thanks for advice. I used now the "view raw" to get the link to the actual .ipk and installation went ok.

wget https://github.com/stangri/openwrt-repo/blob/master/luci-mod-advanced-reboot_git-17.080.69173-773734e27-7_all.ipk?raw=true

The current version looks pretty nice. Great job.

Hmmm. I can't get the "advanced reboot" to change the reboot partition properly in my WRT3200ACM.

When I press the "reboot alternative" button, it shows the waiting text for a few seconds and then reverts to the Luci overview page, but it does not reboot the router and does not change values in the u-boot environment.

Thank you. I'm still yet to implement the multi-step reboot/shutdown but I'm afraid to test it on my live router remotely while I'm away. I'm also not sure if I'm married to the "alternative/current" in the buttons and "alternative" label in the status, looks overloaded to me, so I welcome any feedback.

Does the power off work?

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.