mbox series

[0/5] Extend logs and send log to Hawkbit Server

Message ID 20200309101542.27373-1-sbabic@denx.de
Headers show
Series Extend logs and send log to Hawkbit Server | expand

Message

Stefano Babic March 9, 2020, 10:15 a.m. UTC
This series extends the logging functionalities for shellscript. Up now the output
of a shell script is just printed on the stdout when the shell script is started and
it is lost. It is just possible to get the output of a shell script if a console is
connected to the device. This makes difficult to understand when a shell script fails.

The patchset intercepts the stdout and stderr of a forked shell script and sends the
output to the internal SWUPdate's notification, that can be retrieved and redirected
to other units (Webserver, Hawkbit,..).
The simple mapping is:
	- if a shell script writes to stdout ==> SWUPdate issues a TRACE()
	- if a shell script writes to stderr ==> SWUPdate issues an ERROR()

Patchset adds also the feature to send logs to the Hawkbit server. This extends the feedback
that was just used to report a success or failure. The whole log is sent to the Hawkbit
server as part of the update process and this simplifies to find failure's causes.

Stefano Babic (5):
  Factorize calls of system()
  Intercepts the output of shell scripts
  IPC: add get_status_timeout
  Factorize snescape function
  hawkbit: send log of the update to the server

 core/installer.c               |  27 +----
 core/pctl.c                    | 194 ++++++++++++++++++++++++++++++++-
 core/util.c                    |  25 +++++
 handlers/shell_scripthandler.c |  10 +-
 include/network_ipc.h          |   1 +
 include/pctl.h                 |   1 +
 include/util.h                 |   1 +
 ipc/network_ipc.c              |  54 +++++++--
 mongoose/mongoose_interface.c  |  24 ----
 suricatta/server_hawkbit.c     | 151 +++++++++++++++++++++++--
 10 files changed, 415 insertions(+), 73 deletions(-)