]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
firstboot/homectl: hide plymouth splashscreen when asking questions 40558/head
authorLuca Boccassi <luca.boccassi@gmail.com>
Mon, 2 Feb 2026 11:58:19 +0000 (12:58 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 3 Feb 2026 12:21:03 +0000 (13:21 +0100)
When plymouth is enabled, the screen gets all garbled when firstboot
runs and asks questions. Disable the splash screen, but only when
actually asking questions.

src/firstboot/firstboot.c
src/home/homectl.c
src/shared/plymouth-util.c
src/shared/plymouth-util.h

index 55bd273f21aaad2c07da8796aa3751f07b766977..38e3adaed6eca928900daafcc7f2f407cf93adf8 100644 (file)
@@ -43,6 +43,7 @@
 #include "parse-util.h"
 #include "password-quality-util.h"
 #include "path-util.h"
+#include "plymouth-util.h"
 #include "pretty-print.h"
 #include "proc-cmdline.h"
 #include "prompt-util.h"
@@ -110,6 +111,10 @@ static void print_welcome(int rfd, sd_varlink **mute_console_link) {
         assert(rfd >= 0);
         assert(mute_console_link);
 
+        /* Needs to be called before mute_console or it will garble the screen */
+        if (arg_welcome)
+                (void) plymouth_hide_splash();
+
         if (!*mute_console_link && arg_mute_console)
                 (void) mute_console(mute_console_link);
 
index cb73c51b1bb251eb60da630ce12d7439b6f24b8d..c6a3d4b3eb5e16757fc1ae857d36ef20f287d095 100644 (file)
@@ -48,6 +48,7 @@
 #include "percent-util.h"
 #include "pidref.h"
 #include "pkcs11-util.h"
+#include "plymouth-util.h"
 #include "polkit-agent.h"
 #include "pretty-print.h"
 #include "proc-cmdline.h"
@@ -2891,6 +2892,9 @@ static int create_interactively(void) {
                 return 0;
         }
 
+        /* Needs to be called before mute_console or it will garble the screen */
+        (void) plymouth_hide_splash();
+
         _cleanup_(sd_varlink_flush_close_unrefp) sd_varlink *mute_console_link = NULL;
         (void) mute_console(&mute_console_link);
 
index aaf604afd54e9edadd4e3b2649ac847170461edc..38b4f1fe2a14ed6d0fd8fdbeec92eb3e2b72560d 100644 (file)
@@ -56,3 +56,14 @@ int plymouth_send_msg(const char *text, bool pause_spinner) {
 
         return 0;
 }
+
+int plymouth_hide_splash(void) {
+        int r;
+
+        r = plymouth_send_raw("H\0", 2, SOCK_NONBLOCK);
+        if (r < 0)
+                return log_full_errno(ERRNO_IS_NO_PLYMOUTH(r) ? LOG_DEBUG : LOG_WARNING, r,
+                                      "Failed to communicate with plymouth: %m");
+
+        return 0;
+}
index c73b44567c2ee8e9f8f4ade8276b5bd39edd8a83..4030c5bdb62240711d5e3b6160df405c9eec2768 100644 (file)
@@ -7,6 +7,7 @@
 int plymouth_connect(int flags);
 int plymouth_send_raw(const void *raw, size_t size, int flags);
 int plymouth_send_msg(const char *text, bool pause_spinner);
+int plymouth_hide_splash(void);
 
 static inline bool ERRNO_IS_NO_PLYMOUTH(int r) {
         return IN_SET(ABS(r), EAGAIN, ENOENT) || ERRNO_IS_DISCONNECT(r);