[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1120908: trixie-pu: package swupdate/2024.12.1+dfsg-3+deb13u1



Package: release.debian.org
Severity: normal
Tags: trixie
X-Debbugs-Cc: swupdate@packages.debian.org
Control: affects -1 + src:swupdate
User: release.debian.org@packages.debian.org
Usertags: pu

This is a stable update to fix #1118485, which was already fixed in
unstable with an unreleased upstream patch.

[ Reason ]
#1118485 gets users' systems to an inconsistent bootloader state.

[ Impact ]
Upgrades will not succeed, which defeats the purpose of swupdate.

[ Tests ]
Prepare a valid SWU file with wfx and apply it to the system.
Rebooting will fail.

[ Risks ]
The upstream patch fixes a premature change that was introduced in
v2024.12. Only the lua bindings are affected, which is used by a minority
of SWUpdate users.

[ Checklist ]
  [x] *all* changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in (old)stable
  [x] the issue is verified as fixed in unstable

[ Changes ]
Fixes the lua bindings and affected codepaths that break rebooting.
diff -Nru swupdate-2024.12.1+dfsg/debian/changelog swupdate-2024.12.1+dfsg/debian/changelog
--- swupdate-2024.12.1+dfsg/debian/changelog	2025-07-14 12:55:55.000000000 +0200
+++ swupdate-2024.12.1+dfsg/debian/changelog	2025-11-18 08:52:59.000000000 +0100
@@ -1,3 +1,9 @@
+swupdate (2024.12.1+dfsg-3+deb13u1) trixie; urgency=medium
+
+  * Backport: suricatta/wfx: Fix rebooting (Closes: #1118485)
+
+ -- Bastian Germann <bage@debian.org>  Tue, 18 Nov 2025 08:52:59 +0100
+
 swupdate (2024.12.1+dfsg-3) unstable; urgency=medium
 
   [ Quirin Gylstorff ]
diff -Nru swupdate-2024.12.1+dfsg/debian/patches/series swupdate-2024.12.1+dfsg/debian/patches/series
--- swupdate-2024.12.1+dfsg/debian/patches/series	2025-07-14 12:55:24.000000000 +0200
+++ swupdate-2024.12.1+dfsg/debian/patches/series	2025-11-18 08:52:11.000000000 +0100
@@ -1,3 +1,4 @@
 Link-config-to-swupdate-www-path.diff
 Replace-Font-Awesome-5-with-Fork-Awesome.diff
 use-gcc-compiler.diff
+suricatta-wfx-Fix-rebooting.diff
diff -Nru swupdate-2024.12.1+dfsg/debian/patches/suricatta-wfx-Fix-rebooting.diff swupdate-2024.12.1+dfsg/debian/patches/suricatta-wfx-Fix-rebooting.diff
--- swupdate-2024.12.1+dfsg/debian/patches/suricatta-wfx-Fix-rebooting.diff	1970-01-01 01:00:00.000000000 +0100
+++ swupdate-2024.12.1+dfsg/debian/patches/suricatta-wfx-Fix-rebooting.diff	2025-11-18 08:48:00.000000000 +0100
@@ -0,0 +1,126 @@
+Origin: upstream, 6281f3783a303904981523ed8388b468d58eb5a0
+From: "Storm, Christian" <christian.storm@siemens.com>
+Date: Tue, 15 Jul 2025 08:59:07 +0000
+Subject: suricatta/wfx: Fix rebooting via tools/swupdate-progress.c
+
+The changes leading to commit 077ef4f broke rebooting via
+tools/swupdate-progress.c. Hence, adapt the C Lua bridge
+lua_notify_progress() and update its invocation in
+suricatta/server_wfx.lua as well as updating / fixing
+Lua annotations.
+
+Signed-off-by: Christian Storm <christian.storm@siemens.com>
+---
+ corelib/lua_interface.c  | 17 +++++++++--------
+ doc/source/suricatta.rst |  8 ++++----
+ handlers/swupdate.lua    |  5 +++--
+ suricatta/server_wfx.lua |  6 ++++--
+ suricatta/suricatta.lua  |  5 +++--
+ 5 files changed, 23 insertions(+), 18 deletions(-)
+
+diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c
+index 8d57aaa9..1ff3e5e4 100644
+--- a/corelib/lua_interface.c
++++ b/corelib/lua_interface.c
+@@ -1232,17 +1232,18 @@ static int l_stat(lua_State *L)
+  * @brief Dispatch a message to the progress interface.
+  *
+  * @param [Lua] Message to dispatch to progress interface.
++ * @param [Lua] progress_cause_t number (optional), default: CAUSE_NONE
+  * @return [Lua] nil.
+  */
+ int lua_notify_progress(lua_State *L) {
+-  /*
+-   * NOTE: level is INFOLEVEL for the sake of specifying a level.
+-   * It is unused in core/notifier.c :: progress_notifier() as the
+-   * progress emitter doesn't know about log levels.
+-   */
+-  notify(PROGRESS, RECOVERY_NO_ERROR, INFOLEVEL, luaL_checkstring(L, -1));
+-  lua_pop(L, 1);
+-  return 0;
++	lua_Number cause = CAUSE_NONE;
++	if (lua_isnumber(L, -1) == 1) {
++		cause = lua_tonumber(L, -1);
++		lua_pop(L, 1);
++	}
++	notify(PROGRESS, (progress_cause_t)cause, INFOLEVEL, luaL_checkstring(L, -1));
++	lua_pop(L, 1);
++	return 0;
+ }
+ 
+ /**
+diff --git a/doc/source/suricatta.rst b/doc/source/suricatta.rst
+index 474d02cc..a4081a63 100644
+--- a/doc/source/suricatta.rst
++++ b/doc/source/suricatta.rst
+@@ -557,10 +557,10 @@ The ``suricatta.status`` table exposes the ``server_op_res_t`` enum values defin
+ The ``suricatta.notify`` table provides the usual logging functions to the Lua
+ suricatta module matching their uppercase-named pendants available in the C realm.
+ 
+-One notable exception is ``suricatta.notify.progress(message)`` which dispatches the
+-message to the progress interface (see :doc:`progress`). Custom progress client
+-implementations listening and acting on custom progress messages can be realized
+-using this function.
++One notable exception is ``suricatta.notify.progress(message, cause)`` which 
++dispatches the message to the progress interface (see :doc:`progress`). Custom
++progress client implementations listening and acting on custom progress messages
++can be realized using this function.
+ 
+ All notify functions return ``nil``.
+ 
+diff --git a/handlers/swupdate.lua b/handlers/swupdate.lua
+index aa8a31d0..d32f83b9 100644
+--- a/handlers/swupdate.lua
++++ b/handlers/swupdate.lua
+@@ -63,8 +63,9 @@ swupdate.warn  = function(format, ...) end
+ swupdate.debug = function(format, ...) end
+ 
+ --- Lua equivalent of `notify(PROGRESS, ..., msg)`.
+---- @param msg  string  Message to send to progress interface
+-swupdate.progress = function(msg) end
++--- @param msg    string        Message to send to progress interface
++--- @param cause  number | nil  `progress_cause_t` value as defined in `include/progress_ipc.h`
++swupdate.progress = function(msg, cause) end
+ 
+ --- Lua equivalent of `notify(status, error, INFOLEVEL, msg)`.
+ --- @param status  swupdate.RECOVERY_STATUS  Current status, one of `swupdate.RECOVERY_STATUS`'s values
+diff --git a/suricatta/server_wfx.lua b/suricatta/server_wfx.lua
+index 0978ed50..d0b01bad 100644
+--- a/suricatta/server_wfx.lua
++++ b/suricatta/server_wfx.lua
+@@ -1471,8 +1471,10 @@ M.job.workflow.dispatch:set(
+             suricatta.notify.warn("Cannot initialize progress reporting channel, won't send progress.")
+         end
+ 
+-        suricatta.notify.progress(M.utils.string.escape([[{"%s": { "reboot-mode" : "no-reboot"}}]])
+-            :format(suricatta.ipc.progress_cause.CAUSE_REBOOT_MODE))
++        suricatta.notify.progress(
++            M.utils.string.escape([[{ "reboot-mode" : "no-reboot"}]]),
++            suricatta.ipc.progress_cause.CAUSE_REBOOT_MODE
++        )
+ 
+         suricatta.notify.debug(
+             "%s Version '%s' (Type: %s).",
+diff --git a/suricatta/suricatta.lua b/suricatta/suricatta.lua
+index 24d6eb8f..b8707a25 100644
+--- a/suricatta/suricatta.lua
++++ b/suricatta/suricatta.lua
+@@ -47,6 +47,7 @@ suricatta.status = {
+ --
+ -- Translates to `notify(string.format(message, ...))`,
+ -- @see `corelib/lua_interface.c`
++-- except for `suricatta.notify.progress()`.
+ --
+ --- @class suricatta.notify
+ suricatta.notify = {
+@@ -60,8 +61,8 @@ suricatta.notify = {
+     info     = function(message, ...) end,
+     --- @type fun(message: string, ...: any)
+     warn     = function(message, ...) end,
+-    --- @type fun(message: string, ...: any)
+-    progress = function(message, ...) end,
++    --- @type fun(message: string, cause:suricatta.ipc.progress_cause?)
++    progress = function(message, cause) end,
+ }
+ 
+ 

Reply to: