]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
src: Hide console text when splash is requested
authorRay Strode <rstrode@redhat.com>
Fri, 21 Oct 2022 15:33:41 +0000 (11:33 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 29 Nov 2022 14:47:17 +0000 (09:47 -0500)
plymouthd may not be able to show the splash screen as soon as the
boot process wants it shown (if e.g. the driver isn't fully loaded
yet)

In that case, we sit tight and wait. Unfortunately, we aren't
logging boot messages while waiting.

This commit sets KD_GRAPHICS mode early to hide text from hitting
the console, but still tells systemd to print messages.  This way
we get boot logging but don't display the text while we wait on
the splash.

src/libply-splash-core/ply-terminal.c
src/main.c

index eee23c741f0fc36ffef2ddc47b197f93ec956d6b..1a57c6ad55588ceb5b19528351311c06c38acb49 100644 (file)
@@ -323,6 +323,8 @@ ply_terminal_write (ply_terminal_t *terminal,
         assert (terminal != NULL);
         assert (format != NULL);
 
+        ply_terminal_set_mode (terminal, PLY_TERMINAL_MODE_TEXT);
+
         string = NULL;
         va_start (args, format);
         size = vasprintf (&string, format, args);
index ced0f74339d3cd4204fa79d603eb9631d00938c3..a5de2a4a629e8aab56e2c92e234078d0786e8658 100644 (file)
@@ -984,6 +984,14 @@ on_show_splash (state_t *state)
         if (!state->is_attached && state->should_be_attached && has_displays)
                 attach_to_running_session (state);
 
+        if (state->local_console_terminal != NULL)
+                ply_terminal_set_mode (state->local_console_terminal, PLY_TERMINAL_MODE_GRAPHICS);
+
+#ifdef PLY_ENABLE_SYSTEMD_INTEGRATION
+        if (state->is_attached)
+                tell_systemd_to_print_details (state);
+#endif
+
         if (has_displays) {
                 ply_trace ("at least one display already available, so loading splash");
                 show_splash (state);
@@ -1412,10 +1420,6 @@ on_quit (state_t       *state,
         state->quit_trigger = quit_trigger;
         state->should_retain_splash = retain_splash;
 
-#ifdef PLY_ENABLE_SYSTEMD_INTEGRATION
-        tell_systemd_to_stop_printing_details (state);
-#endif
-
         ply_trace ("closing log");
         if (state->session != NULL)
                 ply_terminal_session_close_log (state->session);