From: mike@mgoodwin.net Date: Mon, 23 Oct 2017 14:22:52 +0000 (-0400) Subject: populate-initrd: handle themes with subdirs X-Git-Tag: 0.9.4~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8982822bd8590dcebf14554ed9ce012f4ead45f9;p=thirdparty%2Fplymouth.git 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 --- 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