Need to Add button on Back/Flash firmware page under system tab

Hi,

I have 2 partitions on our board i.e., primary and secondary. So my use case is I want to give permission to user to change the partition according to their need.
I need to add button on sub-tab i.e., Backup/flash firmware under System tab.
This button is for change the boot partition from primary to secondary and vice-versa. I am new in Luci/Lua.
So can anybody help me in this to implement that button on that page and in backend it will check that right now board is in which partitona and it will boot the board in alternate partition.

Please help me to implement both the things from frontend and backend.
Thanks in advance

Regards
Sakshi

Don’t reinvent the wheel here.
There’s already a package called Advanced Reboot which will get you most of the way. Just need to add support for your device.

Hi @lantis1008

From where I will get the code of that Advanced reboot link shared by you

https://forum.openwrt.org/t/web-ui-to-reboot-to-another-partition-for-linksys-zyxel-dual-partition-routers-and-to-power-off-power-down/3423

I have another link for the advanced reboot page which is given below

https://github.com/openwrt/luci/tree/master/applications/luci-app-advanced-reboot

In this we have advanced reboot option in "/master/applications/" path. I think i am using luci code under "/master/modules/luci-mod-admin-full" in my board

What I have done right now when I put all the changes in our board of "master/applications/luci-app-advanced-reboot" then I am getting an error, PFA image:
advance_reboot

Thanks in advance

Regards
Sakshi

Hi,

Can anybody help me to implement this because i am new in this Luci/Lua and i don't know about html. In my openwrt board how to call a function of luci through html i don't know.
So please can anybody knows how to call a luci function through html.

Thanks in advance
Regards
Sakshi

Maybe this can help,when the wrt32x was not supported i remember this post

Hi @m4r

Thanks for your reply.
But when I am adding the above-mentioned URL code, then I am getting the error which I have added earlier. PFA image.

advance_reboot
How can i remove this error?

Thanks in advance

Regards
Sakshi

Hi

I have

root@root:/# cat tmp/sysinfo/model 
QCA IPQ8064/AP161
root@root:/# 

and

root@root:/# cat /tmp/sysinfo/board_name 
ap161
root@root:/# 

Please someone look into this
Thanks in advance

Regards
Sakshi

Hi @m4r

The error which i faced earlier, i have posted the screenshot for that, that i have resolved.
I just changed the

function index()                                                                                                            
  entry({"admin", "system", "advanced_reboot"}, template("advanced_reboot/advanced_reboot"), _("Advanced Reboot"), 90)
  entry({"admin", "system", "advanced_reboot", "reboot"}, post("action_reboot"))
  entry({"admin", "system", "advanced_reboot", "alternative_reboot"}, post("action_altreboot"))
  entry({"admin", "system", "advanced_reboot", "power_off"}, post("action_poweroff"))
end 

to this one

function index()                                                                                                            
  entry({"admin", "system", "advanced_reboot"}, template("advanced_reboot/advanced_reboot"), _("Advanced Reboot"), 90)
  entry({"admin", "system", "advanced_reboot", "reboot"}, call("action_reboot"))
  entry({"admin", "system", "advanced_reboot", "alternative_reboot"}, call("action_altreboot"))
  entry({"admin", "system", "advanced_reboot", "power_off"}, call("action_poweroff"))
end 

After that i am getting this error. PFA image
reboot

Please help me in this.
Thanks in advance

Regards
Sakshi

Why don't you remove the files you've placed manually and install an advanced reboot ipk?

FYI the package name looks like luci-app-advanced-reboot