SWUpdate does not stop after an update with Hawkbit

915 views
Skip to first unread message

Hermann Tchouta

unread,
Aug 18, 2017, 4:53:13 AM8/18/17
to Stefano Babic, swup...@googlegroups.com
Hello Stefano,

i am using swupdate with hawkbit. Once the update is finished and it
shows successful,
I expect swupdate to stop but it still waits for updates. The output
looks like:

Main loop Daemon
[NOTIFY] : EVENT [7] : { "id" : "1", "update" : "forced"}
[NOTIFY] : SWUPDATE started : Software Update started !
Version 1.0
[NOTIFY] : SWUPDATE running : Installation in progress
[ 1514.719950] EXT4-fs (mmcblk0p4): mounted filesystem with ordered
data mode. Opts: (null)
[NOTIFY] : SWUPDATE successful ! SWUPDATE successful !
[NOTIFY] : No SWUPDATE running : Waiting for requests...
Main loop Daemon


How can i make it to stop directly after an update as it is when i use
a USB stick for update?

Regards
Hermann

Stefano Babic

unread,
Aug 18, 2017, 5:11:34 AM8/18/17
to Hermann Tchouta, Stefano Babic, swup...@googlegroups.com
Hi Hermann,
It does not work as you suppose. SWUpdate performs the update, but it
does not take the decision to stop or reboot the system. This is
demanded because an application could take the control.

Anyway, there is also a builtin command after an update is finished. You
can set a "postupdatecmd" in the configuration file, and this is
executed at the end if successful - and you can decide to exit, reboot,
or whatever you want.

Or you can use the "progress" interface and decides on your own. The
tools directory contains the "progress" tool, that can reboot the system
after success. Tool is renamed in Yocto environment, and you can start
it with

swupdate-progress -w -r

Best regards,
Stefano Babic

--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=====================================================================

Hermann Tchouta

unread,
Aug 18, 2017, 5:25:34 AM8/18/17
to Stefano Babic, swup...@googlegroups.com
Thank you very much. This helps.

Hermann Tchouta

unread,
Aug 24, 2017, 6:50:34 AM8/24/17
to Stefano Babic, swup...@googlegroups.com
On 2017-08-18 11:11, Stefano Babic wrote:
> Hi Hermann,
>
> On 18/08/2017 10:52, Hermann Tchouta wrote:
>> Hello Stefano,
>>
>> i am using swupdate with hawkbit. Once the update is finished and it
>> shows successful,
>> I expect swupdate to stop but it still waits for updates. The output
>> looks like:
>>
>> Main loop Daemon
>> [NOTIFY] : EVENT [7] : { "id" : "1", "update" : "forced"}
>> [NOTIFY] : SWUPDATE started : Software Update started !
>> Version 1.0
>> [NOTIFY] : SWUPDATE running : Installation in progress
>> [ 1514.719950] EXT4-fs (mmcblk0p4): mounted filesystem with ordered
>> data
>> mode. Opts: (null)
>> [NOTIFY] : SWUPDATE successful ! SWUPDATE successful !
>> [NOTIFY] : No SWUPDATE running : Waiting for requests...
>> Main loop Daemon
>>
>>
>> How can i make it to stop directly after an update as it is when i
>> use a
>> USB stick for update?
>>
>
> It does not work as you suppose. SWUpdate performs the update, but it
> does not take the decision to stop or reboot the system. This is
> demanded because an sdfapplication could take the control.
>
> Anyway, there is also a builtin command after an update is finished.
> You
> can set a "postupdatecmd" in the configuration file, and this is
> executed at the end if successful - and you can decide to exit,
> reboot,
> or whatever you want.

In the case i want to pass an exit command to "postupdatecmd" so as to
stop swupdate,
which string should i give to "postupdatecmd"?

Actually what i want to do is to report success to the hawkbit server
upon a successful update. How can that be achieved automatically
without me having to
manually type #swupdate -u "-t default -u 192.168.0.100:8080 -i test
-c 2" ?

Thanks

Stefano Babic

unread,
Aug 24, 2017, 7:21:36 AM8/24/17
to Hermann Tchouta, Stefano Babic, swup...@googlegroups.com
Hi Hermann,
???

>
> Actually what i want to do is to report success to the hawkbit server
> upon a successful update. How can that be achieved automatically without
> me having to
> manually type #swupdate -u "-t default -u 192.168.0.100:8080 -i test -c
> 2" ?

Of course, you have to set up your target to do this automatically. But
it is conceptually wrong to report to Hawkibt as soon as SWUpdate has
installed.

System should reboot (and *s..t* can happen), and after a successful
reboot the Hawkbit should be informed. If you send the message after
installing, and for some reasons the target starts a fallback (that
means the previous version will be run), you have misaligned Hawkbit and
target.

Correct behaviour is (good case):

- update successful
- reboot with new software
- check everything is ok
- starts SWUpdate with "-c 2"

Or (bad case):
- update successful
- reboot with new software
- it does not boot, or some checks fail, or whatever
- fallback
- starts SWUpdate with "-c 3"

Arun Sooraj PS

unread,
Sep 29, 2017, 3:15:33 AM9/29/17
to swupdate
Hi Stefano, 

How can I send an "update successfull" message to hawkbit without a reboot. I know it is not a good practice but I need to know whether it is possible. What string should be assigned to -p for doing that.?

with regards, 

Arun Sooraj PS 

Stefano Babic

unread,
Sep 29, 2017, 6:08:26 AM9/29/17
to Arun Sooraj PS, swupdate
On 29/09/2017 09:15, Arun Sooraj PS wrote:
> Hi Stefano, 
>
> How can I send an "update successfull" message to hawkbit without a
> reboot. I know it is not a good practice but I need to know whether it
> is possible. What string should be assigned to -p for doing that.?
>
> with regards, 

You can do it, it was just tested after a reboot putting swupdate in
"Waiting" status.

There is a IPC to communicate with the Hawkbit backend. Take a look at
the examples directory, sendtohawkbit tool.

Best regards,
Stefano Babic
> <http://192.168.0.100:8080> -i test -c
> sba...@denx.de <javascript:>
> =====================================================================
>
> --
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swupdate+u...@googlegroups.com
> <mailto:swupdate+u...@googlegroups.com>.
> To post to this group, send email to swup...@googlegroups.com
> <mailto:swup...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages