]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
plymouth-populate-initrd: Don't assume the ImageDir is the theme-dir
authorHans de Goede <hdegoede@redhat.com>
Wed, 9 Jan 2019 13:38:26 +0000 (14:38 +0100)
committerHans de Goede <hdegoede@redhat.com>
Wed, 16 Jan 2019 08:29:32 +0000 (09:29 +0100)
Before this commit plymouth-populate-initrd was only recursively copying the
/usr/share/plymouth/themes/$PLYMOUTH_THEME_NAME to the initrd, assuming
that ImageDir will point there.

This makes it impossible for 2 themes to share their ImageDir, which is
desirable for example for the spinner and bgrt themes, which use the same
images with slightly different settings.

This commit also makes plymouth-populate-initrd also copy the ImageDir
if it is different from the theme-dir, making it possible for ImageDir
to point to a different dir.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
scripts/plymouth-populate-initrd.in

index c2f46c0f148c791bb4dac4aaa9e665a862368491..109b649e0d12bbe4f312e54e20fdbdd1dee90c72 100755 (executable)
@@ -412,6 +412,8 @@ if [ $THEME_OVERRIDE ]; then
 fi
 
 PLYMOUTH_MODULE_NAME=$(grep "ModuleName *= *" ${PLYMOUTH_DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}/${PLYMOUTH_THEME_NAME}.plymouth | sed 's/ModuleName *= *//')
+PLYMOUTH_THEME_DIR="${PLYMOUTH_DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}"
+PLYMOUTH_IMAGE_DIR=$(grep "ImageDir *= *" ${PLYMOUTH_THEME_DIR}/${PLYMOUTH_THEME_NAME}.plymouth | sed 's/ImageDir *= *//')
 
 if [ ! -f ${PLYMOUTH_PLUGIN_PATH}/${PLYMOUTH_MODULE_NAME}.so ]; then
     echo "The default plymouth plugin (${PLYMOUTH_MODULE_NAME}) doesn't exist" >&2
@@ -423,8 +425,12 @@ inst ${PLYMOUTH_PLUGIN_PATH}/${PLYMOUTH_MODULE_NAME}.so $INITRDDIR
 [ -f "${PLYMOUTH_PLUGIN_PATH}/renderers/drm.so" ] && inst ${PLYMOUTH_PLUGIN_PATH}/renderers/drm.so $INITRDDIR
 inst ${PLYMOUTH_PLUGIN_PATH}/renderers/frame-buffer.so $INITRDDIR
 
-if [ -d ${PLYMOUTH_DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME} ]; then
-     inst_recur "${PLYMOUTH_DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}"
+if [ -d "${PLYMOUTH_THEME_DIR}" ]; then
+     inst_recur "${PLYMOUTH_THEME_DIR}"
+fi
+
+if [ "${PLYMOUTH_IMAGE_DIR}" != "${PLYMOUTH_THEME_DIR}" -a -d "${PLYMOUTH_IMAGE_DIR}" ]; then
+     inst_recur "${PLYMOUTH_IMAGE_DIR}"
 fi
 
 if [ -L ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth ]; then