]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[main] Try to be smarter about init=/foo on kernel command line
authorRay Strode <rstrode@redhat.com>
Wed, 21 Jul 2010 03:02:54 +0000 (23:02 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 21 Jul 2010 03:02:54 +0000 (23:02 -0400)
Right now, we put plymouth into a sort of degraded mode when we
find init=/anything on the kernel command line.  This is so if
the user does init=/bin/sh to get fix their system, we don't
get in the way.

This breaks plymouth for things like init=/sbin/bootchartd and even
init=/sbin/init.  We've previously had a plymouth.override-splash
kernel command line option to force plymouth on in those cases.

This commit flips things around a bit.  Now init=/sbin/bootchartd
will work by default and there's a new option
plymouth.ignore-show-splash which forces things back into degraded
mode.  We also will implicitly do the degraded mode for e.g.
init=/foo/barsh

src/main.c

index a107b5d40bab42782bf87f8a39cc7a648fa711f6..e1dfacd657feba2717294d9387a0022dd2f8e0f7 100644 (file)
@@ -644,11 +644,23 @@ on_error (state_t *state)
 static bool
 plymouth_should_ignore_show_splash_calls (state_t *state)
 {
+  const char *init_string;
+  size_t length;
+
   ply_trace ("checking if plymouth should be running");
   if (state->mode != PLY_MODE_BOOT || command_line_has_argument (state->kernel_command_line, "plymouth.force-splash"))
       return false;
 
-  return command_line_get_string_after_prefix (state->kernel_command_line, "init=") != NULL;
+  if (command_line_has_argument (state->kernel_command_line, "plymouth.ignore-show-splash"))
+      return true;
+
+  init_string = command_line_get_string_after_prefix (state->kernel_command_line, "init=");
+
+  length = strcspn (init_string, " \n");
+  if (length > 2 && ply_string_has_prefix (init_string + length - 2, "sh"))
+    return true;
+
+  return false;
 }
 
 static bool