Send plymouth mailing list submissions to
        plymouth@lists.freedesktop.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.freedesktop.org/mailman/listinfo/plymouth
or, via email, send a message with subject or body 'help' to
        plymouth-requ...@lists.freedesktop.org

You can reach the person managing the list at
        plymouth-ow...@lists.freedesktop.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of plymouth digest..."


Today's Topics:

   1. [PATCH 0/2] Look for config and theme in runtime dir first
      (=?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?=)
   2. [PATCH 2/2] main: Look for config in runtime dir first
      (=?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?=)
   3. [PATCH 1/2] main: Look for theme in runtime dir first
      (=?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?=)
   4. Re: [PATCH 1/2] main: Look for theme in runtime dir first
      (João Paulo Rechi Vita)
   5. Re: [PATCH 0/2] Look for config and theme in runtime dir
      first (Ray Strode)


----------------------------------------------------------------------

Message: 1
Date: Fri,  7 Apr 2017 10:01:15 -0400
From: "=?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?="
        <jprv...@gmail.com>
To: plymouth@lists.freedesktop.org
Cc: li...@endlessm.com, João Paulo Rechi Vita <jprv...@endlessm.com>
Subject: [PATCH 0/2] Look for config and theme in runtime dir first
Message-ID: <20170407140117.6062-1-jprv...@endlessm.com>
Content-Type: text/plain; charset=UTF-8

As I have mentioned in a previous email (subject: "Shipping a theme only in the
initramfs"), at Endless we want to have boot splash animation customization in
a self-contained initrd. For that to work, we need to make it available after
the initrd is gone as well, because 1) plymouth may show the splash only after
the switch root has already happened; and 2) we want to use the same theme for
the shutdown splash animation.

To achieve that we ship a service in the initrd which copy the custom config
file and theme (if they are found) to /run/plymouth. This patchset makes
plymouth look for these files in /run before checking their default locations.

I'm sending these for feedback and in case there is interest in having this
mechanism upstream. I can send the service files as well if there is interest,
but in that case we'll need to agree on what is a good generic trigger
mechanism (we ship these in a Endless-specific path, and use that as the
trigger).

João Paulo Rechi Vita (2):
  main: Look for theme in runtime dir first
  main: Look for config in runtime dir first

 configure.ac    |  3 +++
 src/Makefile.am |  3 ++-
 src/main.c      | 29 ++++++++++++++++++++++++-----
 3 files changed, 29 insertions(+), 6 deletions(-)

-- 
2.11.0



------------------------------

Message: 2
Date: Fri,  7 Apr 2017 10:01:17 -0400
From: "=?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?="
        <jprv...@gmail.com>
To: plymouth@lists.freedesktop.org
Cc: li...@endlessm.com, João Paulo Rechi Vita <jprv...@endlessm.com>
Subject: [PATCH 2/2] main: Look for config in runtime dir first
Message-ID: <20170407140117.6062-3-jprv...@endlessm.com>
Content-Type: text/plain; charset=UTF-8

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 <jprv...@endlessm.com>

https://phabricator.endlessm.com/T15989
---
 src/main.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/main.c b/src/main.c
index 50d1921..eeb4e20 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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);
-- 
2.11.0



------------------------------

Message: 3
Date: Fri,  7 Apr 2017 10:01:16 -0400
From: "=?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?="
        <jprv...@gmail.com>
To: plymouth@lists.freedesktop.org
Cc: li...@endlessm.com, João Paulo Rechi Vita <jprv...@endlessm.com>
Subject: [PATCH 1/2] main: Look for theme in runtime dir first
Message-ID: <20170407140117.6062-2-jprv...@endlessm.com>
Content-Type: text/plain; charset=UTF-8

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 <jprv...@endlessm.com>

https://phabricator.endlessm.com/T15989
---
 configure.ac    |  3 +++
 src/Makefile.am |  3 ++-
 src/main.c      | 20 ++++++++++++++++++--
 3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 97cdfa0..87035c1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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)
 
diff --git a/src/Makefile.am b/src/Makefile.am
index ceb72ba..95ed019 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -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                                        \
diff --git a/src/main.c b/src/main.c
index 02e0082..50d1921 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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)) {
-- 
2.11.0



------------------------------

Message: 4
Date: Fri, 7 Apr 2017 10:08:05 -0400
From: João Paulo Rechi Vita <jprv...@gmail.com>
To: plymouth@lists.freedesktop.org
Cc: li...@endlessm.com, João Paulo Rechi Vita <jprv...@endlessm.com>
Subject: Re: [PATCH 1/2] main: Look for theme in runtime dir first
Message-ID:
        <CA+A7VXW2ebb9GHOzo7jQVK4N_j-q6Pb-L==4rx7qxwamy7-...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

On Fri, Apr 7, 2017 at 10:01 AM, João Paulo Rechi Vita
<jprv...@gmail.com> wrote:

(...)

>
> https://phabricator.endlessm.com/T15989

Sorry, I forgot to remove this link before sending. Feel free to drop
it from both patches, as this is only accessible to Endless employees.

--
João Paulo Rechi Vita
http://about.me/jprvita


------------------------------

Message: 5
Date: Fri, 7 Apr 2017 11:56:32 -0400
From: Ray Strode <halfl...@gmail.com>
To: João Paulo Rechi Vita <jprv...@gmail.com>, plymouth
        <plymouth@lists.freedesktop.org>
Cc: li...@endlessm.com, João Paulo Rechi Vita <jprv...@endlessm.com>
Subject: Re: [PATCH 0/2] Look for config and theme in runtime dir
        first
Message-ID:
        <caa_uwz+vaeupionkg3tqlzlpwpmds8m296d-+9jzqowq_9w...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Hey,

> As I have mentioned in a previous email (subject: "Shipping a theme only in 
> the
> initramfs"), at Endless we want to have boot splash animation customization in
> a self-contained initrd. For that to work, we need to make it available after
> the initrd is gone as well, because 1) plymouth may show the splash only after
> the switch root has already happened; and 2) we want to use the same theme for
> the shutdown splash animation.
Sorry for not replying to that.  I read the message and then took a
mental note to reply and forgot.

> I'm sending these for feedback and in case there is interest in having this
> mechanism upstream.
I've pushed this.  At some point I think it would make sense to switch
to a systemd style conf_files_list/ config_parse api where higher
precedence dirs override lower precedence files on a per-key basis,
but that's really neither here nor there.

thanks for the patch
Ray


------------------------------

Subject: Digest Footer

_______________________________________________
plymouth mailing list
plymouth@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/plymouth


------------------------------

End of plymouth Digest, Vol 77, Issue 1
***************************************

Reply via email to