Hi Stefan,
Right, I see your point now. There was some time ago a discussion on ML
about the topic, this led to commit:
commit 909e6edf53a50d970fa698b5aa65084054ab5743
Author: Stefano Babic <
sba...@denx.de>
Date: Tue Nov 10 12:25:34 2020 +0100
Reset progress value in swupdate_progress_end()
(I reread previous thread because I forgot it..)
The "DONE" is currently sent only by postupdate. But postupdate is
optional, and it can also be sent via IPC by an external command. In
many cases, there is no post-update at all - it depends on
configuration. But the internal state machine cannot rely on it, and it
must emit if an update (that is, an "install") successful was or not. So
it is guaranteed that SWUpdate always emits a "SUCCESS" or "FAILURE"
message, but it is not guaranteed that DONE is sent. The postupdate is
thought as command to be sent after a successful update: so the update
was already successful. It is also questionable if DONE should be
emitted, but it could be in some setup where postupdate is called, but
there is not reboot and it is doing some "housekeeping" (but this could
be maybe integrated as script into sw-description, and then SUCCESS will
also mean that housekeeping was done), and I guess this is quite your
use case.
On the other side and in my setup, if I need something more complex
after an update, I register with the progress interface and I wil ldo
everything in a separate process (like an "extended" swupdate-progress).
I can just say that in my projects, I always check for SUCCESS/FAILURE,
while DONE is ignored (as you see in swupdate-progress), and postupdate
is used by me as alternative to swupdate-progress (and then it reboots
automatically).
>
>> >> That means, the update was successful but nothing was installed,
>> >> resulting that the device should not reboot.
>> >
>> > But shouldn't the post update command behavior in the same way?
>>
>> It should be
>>
>
> [snip]
>
> Let's skip the delay discussion for now.
>
> Regards
>
Best regards,
Stefano