]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
populate-initrd: handle themes with subdirs
authormike@mgoodwin.net <mike@mgoodwin.net>
Mon, 23 Oct 2017 14:22:52 +0000 (10:22 -0400)
committerRay Strode <rstrode@redhat.com>
Thu, 9 Nov 2017 18:23:24 +0000 (13:23 -0500)
Not all distros use the upstream plymouth-populate-initrd
script to populate their initramfs.  As a consequence,
some themes have been developed that use subdirectories,
(which is not supported by plymouth-populate-initrd).

This commit adds support for that feature, so that
preexisting themes get properly installed.

https://bugs.freedesktop.org/show_bug.cgi?id=103424

scripts/plymouth-populate-initrd.in

index d0ffc23fc7083e296a17ad76b4bb36a40d9863d6..c70adbe78f172e193b4fb3102d67b2ab9466c869 100755 (executable)
@@ -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