From: Ray Strode Date: Fri, 7 Aug 2009 19:09:18 +0000 (-0400) Subject: [main] Allow splash to be specified from grub X-Git-Tag: 0.7.0~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73bf320c559af81678aef3261c76cb4d7e5c7fc9;p=thirdparty%2Fplymouth.git [main] Allow splash to be specified from grub We now check the splash from the kernel command line. This allows initrds to ship a few splashes at once and make it changeable at boot time. --- diff --git a/src/main.c b/src/main.c index 0db010d6..a496450e 100644 --- a/src/main.c +++ b/src/main.c @@ -103,6 +103,7 @@ typedef struct uint32_t should_retain_splash : 1; char *console; + char *override_splash_path; int number_of_errors; } state_t; @@ -186,6 +187,34 @@ show_detailed_splash (state_t *state) } } +static void +find_override_splash (state_t *state) +{ + char *splash_string; + + if (state->override_splash_path != NULL) + return; + + splash_string = strstr (state->kernel_command_line, "plymouth:splash="); + + if (splash_string != NULL) + { + char *end; + splash_string = strdup (splash_string + strlen ("plymouth:splash=")); + + end = strstr (splash_string, " "); + + if (end != NULL) + *end = '\0'; + + ply_trace ("Splash is configured to be '%s'", splash_string); + + asprintf (&state->override_splash_path, + PLYMOUTH_THEME_PATH "%s/%s.plymouth", + splash_string, splash_string); + } +} + static void show_default_splash (state_t *state) { @@ -193,8 +222,20 @@ show_default_splash (state_t *state) return; ply_trace ("Showing splash screen"); - state->boot_splash = start_boot_splash (state, - PLYMOUTH_THEME_PATH "default.plymouth"); + find_override_splash (state); + if (state->override_splash_path != NULL) + { + ply_trace ("Starting override splash at '%s'", state->override_splash_path); + state->boot_splash = start_boot_splash (state, + state->override_splash_path); + } + + if (state->boot_splash == NULL) + { + ply_trace ("Starting default splash"); + state->boot_splash = start_boot_splash (state, + PLYMOUTH_THEME_PATH "default.plymouth"); + } if (state->boot_splash == NULL) {