[PATCH] Send no-reboot to progress client on dry-run

12 views
Skip to first unread message

Storm, Christian

unread,
Aug 27, 2025, 8:21:24 AMAug 27
to swup...@googlegroups.com, MOESSBAUER, Felix, toe...@gmail.com
When running SWUpdate in dry-run mode, send the no-reboot
message to the progress client(s).

Signed-off-by: Christian Storm <christi...@siemens.com>
Reported-by: Felix Moessbauer <felix.mo...@siemens.com>
Helped-by: Mark Jonas <toe...@gmail.com>
---
core/stream_interface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/stream_interface.c b/core/stream_interface.c
index 10359c30..22d1dd30 100644
--- a/core/stream_interface.c
+++ b/core/stream_interface.c
@@ -723,7 +723,7 @@ void *network_initializer(void *data)
* send a notification via progress for processes responsible for booting
*/
do_reboot = check_reboot_enabled(software);
- if (!do_reboot) {
+ if (!do_reboot || software->parms.dry_run) {
swupdate_progress_info(RUN, CAUSE_REBOOT_MODE , "{ \"reboot-mode\" : \"no-reboot\"}");
}

--
2.51.0

Stefano Babic

unread,
Aug 27, 2025, 8:27:35 AMAug 27
to Storm, Christian, swup...@googlegroups.com, MOESSBAUER, Felix, toe...@gmail.com
Hi Christian,

On 8/27/25 14:21, 'Storm, Christian' via swupdate wrote:
> When running SWUpdate in dry-run mode, send the no-reboot
> message to the progress client(s).
>
> Signed-off-by: Christian Storm <christi...@siemens.com>
> Reported-by: Felix Moessbauer <felix.mo...@siemens.com>
> Helped-by: Mark Jonas <toe...@gmail.com>
> ---
> core/stream_interface.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/core/stream_interface.c b/core/stream_interface.c
> index 10359c30..22d1dd30 100644
> --- a/core/stream_interface.c
> +++ b/core/stream_interface.c
> @@ -723,7 +723,7 @@ void *network_initializer(void *data)
> * send a notification via progress for processes responsible for booting
> */
> do_reboot = check_reboot_enabled(software);
> - if (!do_reboot) {
> + if (!do_reboot || software->parms.dry_run) {

It seems a derived information: we are running in dry-run, ergo a reboot
shouldn't happen. The receiver cannot know if it was in dry-run mode or
if it was requested to skip the reboot. IMHO SWUpdate shouldn't try to
find this itself, and should just forward the information to the client.
So if dry-run is set, and INFO with dry-run (currently missing) should
be sent.

> swupdate_progress_info(RUN, CAUSE_REBOOT_MODE , "{ \"reboot-mode\" : \"no-reboot\"}");
> }
>

Best regards,
Stefano

Storm, Christian

unread,
Aug 28, 2025, 9:35:03 AMAug 28
to swup...@googlegroups.com, MOESSBAUER, Felix, toe...@gmail.com, Stefano Babic
Hi Stefano,

>> When running SWUpdate in dry-run mode, send the no-reboot
>> message to the progress client(s).
>> Signed-off-by: Christian Storm <christi...@siemens.com>
>> Reported-by: Felix Moessbauer <felix.mo...@siemens.com>
>> Helped-by: Mark Jonas <toe...@gmail.com>
>> ---
>> core/stream_interface.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> diff --git a/core/stream_interface.c b/core/stream_interface.c
>> index 10359c30..22d1dd30 100644
>> --- a/core/stream_interface.c
>> +++ b/core/stream_interface.c
>> @@ -723,7 +723,7 @@ void *network_initializer(void *data)
>> * send a notification via progress for processes responsible for booting
>> */
>> do_reboot = check_reboot_enabled(software);
>> - if (!do_reboot) {
>> + if (!do_reboot || software->parms.dry_run) {
>
> It seems a derived information: we are running in dry-run, ergo a reboot shouldn't happen.
> The receiver cannot know if it was in dry-run mode or if it was requested to skip the reboot.

True, when dry-running, some functionality (here and currently only reboot) should not happen.
The question is whether SWUpdate core or the progress clients decide what to (not) do, as you say:

> IMHO SWUpdate shouldn't try to find this itself, and should just forward the information to the client. So if dry-run is set, and INFO with dry-run (currently missing) should be sent.

OK, I'm also fine with leaving the decision to progress clients, I will come back with patches...


Kind regards,
Christian

--
Dr. Christian Storm
Siemens AG, FT RPD CED
Friedrich-Ludwig-Bauer-Str. 3, 85748 Garching, Germany

Reply all
Reply to author
Forward
0 new messages