main: Look for theme in runtime dir first

When a theme is shipped exclusively in the initrd, plymouth will not be
able to load is if it starts the boot splash after the bootup process
already switched from the initrd. One way to make it work is to copy the
theme to plymouth's runtime directory in /run, which is preserved during
switch root.

This commit changes the routine which resolves a theme's path to have it
look first in themes/ under plymouth's runtime directory.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
calculate-0.9.5
João Paulo Rechi Vita 7 years ago committed by Ray Strode
parent 61ae21f1e8
commit 6535986079

@ -269,6 +269,9 @@ PLYMOUTH_CFLAGS="$PLYMOUTH_CFLAGS $WARN_CFLAGS"
plymouththemedir=$datadir/plymouth/themes
AS_AC_EXPAND(PLYMOUTH_THEME_PATH, $plymouththemedir)
plymouthruntimethemedir=$plymouthruntimedir/themes
AS_AC_EXPAND(PLYMOUTH_RUNTIME_THEME_PATH, $plymouthruntimethemedir)
plymouthplugindir=$libdir/plymouth/
AS_AC_EXPAND(PLYMOUTH_PLUGIN_PATH, $plymouthplugindir)

@ -20,7 +20,8 @@ plymouthd_CFLAGS = $(PLYMOUTH_CFLAGS) \
-DPLYMOUTH_THEME_PATH=\"$(PLYMOUTH_THEME_PATH)/\" \
-DPLYMOUTH_POLICY_DIR=\"$(PLYMOUTH_POLICY_DIR)/\" \
-DPLYMOUTH_RUNTIME_DIR=\"$(PLYMOUTH_RUNTIME_DIR)\" \
-DPLYMOUTH_CONF_DIR=\"$(PLYMOUTH_CONF_DIR)/\"
-DPLYMOUTH_CONF_DIR=\"$(PLYMOUTH_CONF_DIR)/\" \
-DPLYMOUTH_RUNTIME_THEME_PATH=\"$(PLYMOUTH_RUNTIME_THEME_PATH)/\"
plymouthd_LDADD = $(PLYMOUTH_LIBS) libply/libply.la libply-splash-core/libply-splash-core.la
plymouthd_SOURCES = \
ply-boot-protocol.h \

@ -311,8 +311,16 @@ load_settings (state_t *state,
goto out;
asprintf (theme_path,
PLYMOUTH_THEME_PATH "%s/%s.plymouth",
PLYMOUTH_RUNTIME_THEME_PATH "%s/%s.plymouth",
splash_string, splash_string);
ply_trace ("Checking if %s exists", *theme_path);
if (!ply_file_exists (*theme_path)) {
ply_trace ("%s not found, fallbacking to " PLYMOUTH_THEME_PATH,
*theme_path);
asprintf (theme_path,
PLYMOUTH_THEME_PATH "%s/%s.plymouth",
splash_string, splash_string);
}
if (isnan (state->splash_delay)) {
const char *delay_string;
@ -427,8 +435,16 @@ find_override_splash (state_t *state)
ply_trace ("Splash is configured to be '%*.*s'", length, length, splash_string);
asprintf (&state->override_splash_path,
PLYMOUTH_THEME_PATH "%*.*s/%*.*s.plymouth",
PLYMOUTH_RUNTIME_THEME_PATH "%*.*s/%*.*s.plymouth",
length, length, splash_string, length, length, splash_string);
ply_trace ("Checking if %s exists", state->override_splash_path);
if (!ply_file_exists (state->override_splash_path)) {
ply_trace ("%s not found, fallbacking to " PLYMOUTH_THEME_PATH,
state->override_splash_path);
asprintf (&state->override_splash_path,
PLYMOUTH_THEME_PATH "%*.*s/%*.*s.plymouth",
length, length, splash_string, length, length, splash_string);
}
}
if (isnan (state->splash_delay)) {

Loading…
Cancel
Save