]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
main: Look for config in runtime dir first
authorJoão Paulo Rechi Vita <jprvita@gmail.com>
Fri, 7 Apr 2017 14:01:17 +0000 (10:01 -0400)
committerRay Strode <rstrode@redhat.com>
Fri, 7 Apr 2017 15:43:58 +0000 (11:43 -0400)
This makes possible to support shipping a self-contained initrd which
completely overrides the plymouth theme. The configuration and theme are
copied to /run by a custom service before plymouth starts, so plymouth
can load the correct config from /run both during bootup and shutdown.

This commit changes the routine which resolves plymouth.defaults' path,
to have it look first in plymouth's runtime directory.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
src/main.c

index 50d192106f48e01b9f321329497e910656312a9d..eeb4e20d4e695807c6250c57f25e666c9d7b3656 100644 (file)
@@ -488,9 +488,12 @@ find_distribution_default_splash (state_t *state)
         if (state->distribution_default_splash_path != NULL)
                 return;
 
-        if (!load_settings (state, PLYMOUTH_POLICY_DIR "plymouthd.defaults", &state->distribution_default_splash_path)) {
-                ply_trace ("failed to load " PLYMOUTH_POLICY_DIR "plymouthd.defaults");
-                return;
+        if (!load_settings (state, PLYMOUTH_RUNTIME_DIR "/plymouthd.defaults", &state->distribution_default_splash_path)) {
+                ply_trace ("failed to load " PLYMOUTH_RUNTIME_DIR "/plymouthd.defaults, trying " PLYMOUTH_POLICY_DIR);
+                if (!load_settings (state, PLYMOUTH_POLICY_DIR "plymouthd.defaults", &state->distribution_default_splash_path)) {
+                        ply_trace ("failed to load " PLYMOUTH_POLICY_DIR "plymouthd.defaults");
+                        return;
+                }
         }
 
         ply_trace ("Distribution default theme file is '%s'", state->distribution_default_splash_path);