Skip to content
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

Draft
wants to merge 118 commits into
base: master
Choose a base branch
from

Conversation

javierbrk
Copy link
Collaborator

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.

javierbrk and others added 30 commits October 6, 2023 14:03
also Adds the following methods:
start_node_download(url)
state()
change_state()
adds new methods to eupgrade like "is_meshupgrade_enabled" and
"set_custom_api_url"
fixes some reduntant methods call
@selankon selankon changed the title Feature/mesh upgrade Implement mesh upgrade package May 13, 2024
@selankon selankon added this to the mesh-wide milestone May 13, 2024
Copy link
Member

@G10h4ck G10h4ck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comments

CATEGORY:=LibreMesh
MAINTAINER:=selankon <[email protected]>
TITLE:=LibreMesh mesh wide firmware upgrade
DEPENDS:= +lua +libubus-lua +wget +safe-upgrade \
Copy link
Member

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'

Copy link
Member

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.

Copy link
Collaborator Author

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
Copy link
Member

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
Copy link
Member

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
]]--
Copy link
Member

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
Copy link
Collaborator

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants