From 0e21dc894b4aff668fb8b6e4d836b5b82fe0b9fa Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 11 Feb 2026 04:50:58 +0100 Subject: [PATCH] package/finit: backport fixes from upstream Signed-off-by: Joachim Wiberg --- ...Don-t-hide-cursor-when-shutting-down.patch | 31 ++++++++++ ...ad-NAME-not-updating-conditions-for-.patch | 61 +++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 package/finit/0004-Don-t-hide-cursor-when-shutting-down.patch create mode 100644 package/finit/0005-Fix-initctl-reload-NAME-not-updating-conditions-for-.patch diff --git a/package/finit/0004-Don-t-hide-cursor-when-shutting-down.patch b/package/finit/0004-Don-t-hide-cursor-when-shutting-down.patch new file mode 100644 index 00000000..4c6086db --- /dev/null +++ b/package/finit/0004-Don-t-hide-cursor-when-shutting-down.patch @@ -0,0 +1,31 @@ +From 7090321ff3c812644507d43e1ddea25de8cff93a Mon Sep 17 00:00:00 2001 +From: Joachim Wiberg +Date: Tue, 10 Feb 2026 15:58:46 +0100 +Subject: [PATCH 4/5] Don't hide cursor when shutting down +Organization: Wires + +Users starting Finit based systems using U-Boot or Barebox may otherwise +not get a visible cursor at their prompt. + +Signed-off-by: Joachim Wiberg +--- + src/sm.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/src/sm.c b/src/sm.c +index a1e982b..f23fa65 100644 +--- a/src/sm.c ++++ b/src/sm.c +@@ -361,9 +361,6 @@ restart: + + /* Restore terse mode and run hooks before shutdown */ + if (runlevel == 0 || runlevel == 6) { +- /* Hide cursor, we're going down ... */ +- dprint(STDOUT_FILENO, "\033[?25l", 6); +- + api_exit(); + log_exit(); + plugin_run_hooks(HOOK_SHUTDOWN); +-- +2.43.0 + diff --git a/package/finit/0005-Fix-initctl-reload-NAME-not-updating-conditions-for-.patch b/package/finit/0005-Fix-initctl-reload-NAME-not-updating-conditions-for-.patch new file mode 100644 index 00000000..b51d47ed --- /dev/null +++ b/package/finit/0005-Fix-initctl-reload-NAME-not-updating-conditions-for-.patch @@ -0,0 +1,61 @@ +From f0914f6d32b9cd055a888cf0a1c7e45dec871824 Mon Sep 17 00:00:00 2001 +From: Joachim Wiberg +Date: Tue, 10 Feb 2026 15:59:49 +0100 +Subject: [PATCH 5/5] Fix 'initctl reload NAME' not updating conditions for + dependents +Organization: Wires + +When reloading a specific service with 'initctl reload foo', the +pid/foo and service/foo/ready conditions were never cleared, so +dependent services were not notified of the reload. + +Clear the service's pid condition and, for pid/none notify types, +the ready condition before reloading. The conditions are then +reasserted by the pidfile inotify handler when the service touches +its PID file after processing SIGHUP. + +For s6/systemd services the ready condition is left intact since +their readiness notification may not re-trigger on SIGHUP. + +Signed-off-by: Joachim Wiberg +--- + src/api.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/src/api.c b/src/api.c +index 381c219..8537335 100644 +--- a/src/api.c ++++ b/src/api.c +@@ -112,6 +112,8 @@ static int restart(svc_t *svc, void *user_data) + + static int reload(svc_t *svc, void *user_data) + { ++ char cond[MAX_COND_LEN]; ++ + (void)user_data; + + if (!svc) +@@ -122,6 +124,20 @@ static int reload(svc_t *svc, void *user_data) + else + service_timeout_cancel(svc); + ++ /* ++ * Clear conditions before reload to ensure dependent services ++ * are properly updated. The conditions are reasserted when ++ * the service touches its PID file after processing SIGHUP. ++ * ++ * Note: only clear 'ready' for services where the pidfile ++ * inotify handler reasserts it (pid/none). For s6/systemd ++ * services readiness relies on their respective notification ++ * mechanism which may not re-trigger on SIGHUP. ++ */ ++ cond_clear(mkcond(svc, cond, sizeof(cond))); ++ if (svc->notify == SVC_NOTIFY_PID || svc->notify == SVC_NOTIFY_NONE) ++ service_ready(svc, 0); ++ + svc_mark_dirty(svc); + service_step(svc); + +-- +2.43.0 +