Please accept this patch to recursively include theme files in dracut

Michael Goodwin xenithorb at fedoraproject.org
Fri Oct 20 01:25:26 UTC 2017


Hi, 

I'm submitting this patch because I have encountered problems with dracut 
being able to include anything but flat themes. Some themes such as "plymouth-
theme-breeze" contain directories with images (in this case ./images) and I 
believe the script scripts/plymouth-populate-initrd.in should handle this 
better, as well as the dracut-only script `modules.d/50plymouth/plymouth-
populate-initrd.sh` for which I will be contacting that project separately.

I'm pasting the patch inline below for reading, and including it as a file for 
your convenience.

Thanks,

Mike

-------------------- INLINE PATCH BELOW FOR READING ------------------------

>From 9dc3ae5737989166434b845e2c7b985d9ae832d9 Mon Sep 17 00:00:00 2001
From: Michael Goodwin <xenithorb at fedoraproject.org>
Date: Thu, 19 Oct 2017 20:46:42 -0400
Subject: [PATCH 1/1] scripts: Add inst_recur for adding themes recursively

Some themes are configured and shipped with directories and aren't flat
this patch solves that by writing a pure bash function to recurse over
those directories and files in order to include every bit of the theme
into the initramfs.

Without this, users typically experience a black screen at boot time and
don't understand why their theme doesn't function:

https://bugs.kde.org/show_bug.cgi?id=371276
https://src.fedoraproject.org/rpms/plymouth-theme-breeze/c/
8ddf072a892e92afe1262a8a2c683574cc63c4b7

A similar funciton and patch will be filed for the dracut-only
component: `modules.d/50plymouth/plymouth-populate-initrd.sh`
---
 scripts/plymouth-populate-initrd.in | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/scripts/plymouth-populate-initrd.in b/scripts/plymouth-populate-
initrd.in
index d0ffc23..c70adbe 100755
--- a/scripts/plymouth-populate-initrd.in
+++ b/scripts/plymouth-populate-initrd.in
@@ -336,6 +336,19 @@ inst_any() {
     return 1
 }

+inst_recur() {
+    for x in "${1%/}"/* ; do
+        if [[ -d "$x" ]]; then
+            inst_dir "$x"
+            inst_recur "$x"
+        elif [[ -f "$x" ]]; then
+            inst "$x"
+        else
+            break
+        fi
+    done
+}
+
 function usage() {
     local output="/proc/self/fd/1"
     local rc=0
@@ -411,10 +424,7 @@ inst ${PLYMOUTH_PLUGIN_PATH}/${PLYMOUTH_MODULE_NAME}.so 
$INITRDDIR
 inst ${PLYMOUTH_PLUGIN_PATH}/renderers/frame-buffer.so $INITRDDIR

 if [ -d ${PLYMOUTH_DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME} ]; then
-    for x in ${PLYMOUTH_DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}/* ; 
do
-        [ ! -f "$x" ] && continue
-        inst $x $INITRDDIR
-    done
+     inst_recur "${PLYMOUTH_DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}"
 fi

 if [ -L ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth ]; then
--
2.14.2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-scripts-Add-inst_recur-for-adding-themes-recursively.patch
Type: text/x-patch
Size: 2113 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/plymouth/attachments/20171020/03fc474e/attachment.bin>


More information about the plymouth mailing list