From 8982822bd8590dcebf14554ed9ce012f4ead45f9 Mon Sep 17 00:00:00 2001 From: "mike@mgoodwin.net" Date: Mon, 23 Oct 2017 10:22:52 -0400 Subject: [PATCH] populate-initrd: handle themes with subdirs 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 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/plymouth-populate-initrd.in b/scripts/plymouth-populate-initrd.in index d0ffc23f..c70adbe7 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.47.3