mbox series

[V2,00/11] Handle Hawkbit action_id and on the fly updates

Message ID 20231017140657.95860-1-stefano.babic@swupdate.org
Headers show
Series Handle Hawkbit action_id and on the fly updates | expand

Message

Stefano Babic Oct. 17, 2023, 2:06 p.m. UTC
Getting the action_id from an update via Hawkbit has always required
to implement something that reads the action_id when issued by SWUpdate, and finds
a way to store permanently. This was often tricky. If it is not done, SWUpdate
asks the Server for the action_id, but this leads to a mismatch if the operator
has cancelled the update. The result could be that SWUpdate acknowledge an update
that was not yet done, and the device still runs an older verion.

With the support of application variables, SWUpdate can store for itself
variables that are not for the bootloader. With this series, the action_id is
stored and retrieved by SWUpdate without asking the Hawkbit server, solving the
issue above.

Variables can be set only by the core, that means an IPC is introduced to let
processes with low-rights like suricatta to store values.

Enhance sw-description adding a "reboot" attribute. If set to false, the update
is decölared as "free from reboot" (on the fly updates without bootloader involvement).
I freboot is deactivated, SWUPdate will:
- send automatically the result to the Hawkbit Server if update is coming from it.
- swupdate-progress will skip the reboot.

Stefano Babic (11):
  IPC: add SET_SWUPDATE_VARS and GET_SWUPDATE_VARS
  Store globally namespace for swupdate_vars
  Implement IPC to set / get SWUpdate's vars
  hawkbit: add server name into the IPC request
  hawkbit: use stored action_id instead of current
  IPC: check if variable is set in SET_SWUPDATE_VARS
  Enum for cause field in progress messages
  Reset action_id after usage
  Send information to backend in case of on the fly updates
  swupdate-progress: parse if reboot is disabled
  doc: document the "reboot" attribute

 core/network_thread.c         | 17 ++++++++
 core/parser.c                 |  2 +-
 core/stream_interface.c       | 41 ++++++++++++++++++
 core/swupdate.c               |  6 +++
 core/swupdate_vars.c          | 78 ++++++++++++++++++++++++++++++++---
 doc/source/sw-description.rst | 30 ++++++++++++++
 include/network_ipc.h         |  9 +++-
 include/progress_ipc.h        |  5 +++
 include/swupdate.h            |  1 +
 include/swupdate_vars.h       |  2 +
 parser/parser.c               | 13 ++++++
 suricatta/server_hawkbit.c    | 72 ++++++++++++++++++++++++++++----
 tools/swupdate-progress.c     | 30 ++++++++++++--
 13 files changed, 287 insertions(+), 19 deletions(-)