-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement mesh upgrade package #1109
base: master
Are you sure you want to change the base?
Conversation
also Adds the following methods: start_node_download(url) state() change_state()
…ages into feature/mesh-upgrade
…ges into feature/mesh-upgrade
…ges into feature/mesh-upgrade
adds new methods to eupgrade like "is_meshupgrade_enabled" and "set_custom_api_url" fixes some reduntant methods call
…ages into feature/mesh-upgrade
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See inline comments
packages/lime-mesh-upgrade/Makefile
Outdated
CATEGORY:=LibreMesh | ||
MAINTAINER:=selankon <[email protected]> | ||
TITLE:=LibreMesh mesh wide firmware upgrade | ||
DEPENDS:= +lua +libubus-lua +wget +safe-upgrade \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wget
is a huge dependency, can't we use something already shipped within OpenWrt? The name should be uclient-fetch
or something similar, shared-state Lua use it AFAIR.
I'd remove that space after DEPENDS:=
if not mandatory ;-)
option retry_count '0' | ||
option safeupgrade_start_mark '0' | ||
option su_start_time_out '0' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing new line.
I am not sure if we should use a config file per se, or this should end up into /etc/config/lime-*
with the other configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this config file main reason to exist is to keep the settings and status of the current upgrade. This is to be keep across, operating system process, reboots and sysupgrades. It is a backend mesh-upgrade state and config persistence.
local json = require 'luci.jsonc' | ||
|
||
local mesh_upgrade = { | ||
-- posible transaction states are derived from upgrade states |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
posSible
TITLE:=Babel links module for shared-state | ||
MAINTAINER:=Asociación Civil Altermundi <[email protected]> | ||
DEPENDS:=+lua +luci-lib-jsonc +ubus-lime-utils \ | ||
+libubus-lua +random-numgen shared-state-async |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use plain $RANDOM
variable in scripts and drop dependency on random-numgen
utils.unsafe_shell('logger -p daemon.info -t "async: mesh upgrade" "already started an upgrade process"') | ||
utils.log("already started an upgrade process") | ||
end | ||
]]-- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this comment block a leftover that should be removed before merging?
|
||
define Package/$(PKG_NAME) | ||
CATEGORY:=LibreMesh | ||
TITLE:=Babel links module for shared-state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not the correct description :)
Mesh upgrade
This package can help you upgrade the firmware of all the routers in a network from a single node.
Description and steps
1- A node must become main node, the main node will fetch the firmware for all the others. And expose it in the local network.
2- The main node announces the new firmware over shared-state-async
3- Other nodes with this package will get the news and try to download the firmware.
4- Once all the nodes have the firmware in their tmp folder the main node user will be able to schedule the safe upgrade of all the nodes (this last step is done synchronously).
5- After the specified time (60s default) all the nodes will start the safe upgrade process and the nodes will reboot.
6- The nodes will report that the new firmware has to be confirmed.
7- The main node user will verify that everything is in place an press the confirm button.
8- If the firmware is not confirmed after 600 seconds the routers will go back to the previous firmware.