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
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