From: Ray Strode Date: Tue, 11 Nov 2008 15:01:08 +0000 (-0500) Subject: Hide splash if init=/bin/bash is on command line X-Git-Tag: 0.6.0~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3022a696fced0fdbe147d432f58d3aad6478b847;p=thirdparty%2Fplymouth.git Hide splash if init=/bin/bash is on command line Previously, we were just showing detailed splash, but that causes keystrokes to get eaten. --- diff --git a/src/main.c b/src/main.c index 677b85c4..c2ef5683 100644 --- a/src/main.c +++ b/src/main.c @@ -79,6 +79,7 @@ static ply_window_t *create_window (state_t *state, static bool attach_to_running_session (state_t *state); static void on_escape_pressed (state_t *state); +static void on_hide_splash (state_t *state); static void on_session_output (state_t *state, @@ -250,14 +251,20 @@ has_open_window (state_t *state) } static bool -plymouth_should_show_default_splash (state_t *state) +plymouth_should_ignore_show_splash_calls (state_t *state) { ply_trace ("checking if plymouth should be running"); + return ply_string_has_prefix (state->kernel_command_line, "init=") || strstr (state->kernel_command_line, " init=") != NULL; +} + +static bool +plymouth_should_show_default_splash (state_t *state) +{ + ply_trace ("checking if plymouth should show default splash"); const char const *strings[] = { " single ", " single", "^single ", " 1 ", " 1", "^1 ", - " init=", "^init=", NULL }; int i; @@ -335,6 +342,13 @@ static void on_show_splash (state_t *state) { bool has_window; + bool should_ignore_show_splash; + + if (plymouth_should_ignore_show_splash_calls (state)) + { + on_hide_splash (state); + return; + } open_windows (state); @@ -381,8 +395,9 @@ quit_splash (state_t *state) static void on_hide_splash (state_t *state) { + if (state->boot_splash != NULL) + ply_trace ("hiding boot splash"); - ply_trace ("hiding boot splash"); state->showing_details = false; on_escape_pressed (state); if (state->boot_splash != NULL)