]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
main: add plymouth.ignore-serial-consoles
authorRay Strode <rstrode@redhat.com>
Wed, 25 Apr 2012 22:22:00 +0000 (18:22 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 25 Apr 2012 22:22:00 +0000 (18:22 -0400)
This commit adds plymouth.ignore-serial-consoles kernel command
line for OLPC to use.

Eventually, we'll support multiple plugins at once, and we can
run details on the serial console and e.g. two-step on the main
console and then this argument won't be needed.

src/main.c

index 191c514e5987823b0cef726701fb10b07d082d5e..c85fe4c6e9b9dcc276188b1bb409d03b806b82ab 100644 (file)
@@ -2018,19 +2018,30 @@ check_for_consoles (state_t    *state,
   char *console;
   ply_hashtable_t *consoles;
   int num_consoles;
+  bool ignore_serial_consoles;
 
   ply_trace ("checking for consoles%s",
              should_add_displays? " and adding displays": "");
 
   consoles = ply_hashtable_new (ply_hashtable_string_hash,
                                 ply_hashtable_string_compare);
+  ignore_serial_consoles = command_line_has_argument (state->kernel_command_line, "plymouth.ignore-serial-consoles");
 
-  num_consoles = add_consoles_from_file (state, consoles, "/sys/class/tty/console/active");
+  num_consoles = 0;
+
+  if (!ignore_serial_consoles)
+    {
+      num_consoles = add_consoles_from_file (state, consoles, "/sys/class/tty/console/active");
 
-  if (num_consoles == 0)
+      if (num_consoles == 0)
+        {
+          ply_trace ("falling back to kernel command line");
+          num_consoles = add_consoles_from_kernel_command_line (state, consoles);
+        }
+    }
+  else
     {
-      ply_trace ("falling back to kernel command line");
-      num_consoles = add_consoles_from_kernel_command_line (state, consoles);
+      ply_trace ("ignoring all consoles but default console because of plymouth.ignore-serial-consoles");
     }
 
   console = ply_hashtable_remove (consoles, (void *) "/dev/tty0");