]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
main: Assume graphical splash when the active kernel console is /dev/ttynull.
authornerdopolis <bluescreen_avenger@verizon.net>
Fri, 2 Aug 2024 12:00:10 +0000 (08:00 -0400)
committernerdopolis <bluescreen_avenger@verizon.net>
Tue, 6 Aug 2024 02:21:06 +0000 (22:21 -0400)
src/main.c

index 33fe51e0766bcee5bd58ff696f9a2f6c03627d35..9c98bedfc0a5243584df6d44a9d7ad5635e4ddb0 100644 (file)
@@ -884,6 +884,19 @@ sh_is_init (state_t *state)
         return result;
 }
 
+static bool
+kernel_console_is_ttynull (void)
+{
+        char *kernel_console = ply_get_primary_kernel_console_type ();
+
+        /* If the primary console is ttynull, the kernel console is virtual.
+         */
+        if (strcmp (kernel_console, "ttynull") == 0)
+                return true;
+
+        return false;
+}
+
 static bool
 plymouth_should_show_default_splash (state_t *state)
 {
@@ -925,7 +938,7 @@ plymouth_should_show_default_splash (state_t *state)
         }
 
         if (state->should_force_default_splash) {
-                ply_trace ("using default splash because kernel command line has option \"plymouth.graphical\"");
+                ply_trace ("using default splash because forced by \"plymouth.graphical\" or no active kernel console");
                 return true;
         }
 
@@ -2457,7 +2470,7 @@ main (int    argc,
         signal (SIGSEGV, on_crash);
         signal (SIGFPE, on_crash);
 
-        if (graphical_boot || ply_kernel_command_line_has_argument ("plymouth.graphical")) {
+        if (graphical_boot || ply_kernel_command_line_has_argument ("plymouth.graphical") || kernel_console_is_ttynull ()) {
                 state.should_force_default_splash = true;
                 ignore_serial_consoles = true;
         }