]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Make plymouth-populate-initrd run "plymouth-set-default-plugin --reset" if none is...
authorPeter Jones <pjones@redhat.com>
Tue, 17 Jun 2008 15:47:23 +0000 (11:47 -0400)
committerPeter Jones <pjones@pjones2.localdomain>
Tue, 17 Jun 2008 15:47:23 +0000 (11:47 -0400)
scripts/plymouth-populate-initrd.in
scripts/plymouth-set-default-plugin

index c2ba60b64027b2290a26c3918af09cdf559a11e2..c52f39ee16433249ca5db399946967ac4eb819a1 100755 (executable)
@@ -102,16 +102,17 @@ install -m755 ${LIBDIR}/plymouth/details.so ${INITRDDIR}${LIBDIR}/plymouth
 install -D -m644 ${PLYMOUTH_LOGO_FILE} ${INITRDDIR}${PLYMOUTH_LOGO_FILE}
 mkdir -p ${INITRDDIR}${DATADIR}/plymouth
 
-if [ ! -L ${LIBDIR}/plymouth/default.so ]; then
-   echo "${LIBDIR}/plymouth/default.so needs to be a symlink to desired plugin" > /dev/stderr
-   exit 1;
-fi
 
-PLUGIN_NAME=$(basename $(readlink ${LIBDIR}/plymouth/default.so) .so)
+PLUGIN_NAME=$(plymouth-set-default-plugin)
+
+if [ -z "$PLUGIN_NAME" ]; then
+   echo "No default plymouth plugin is set" > /dev/stderr
+   exit 1
+fi
 
 if [ ! -f ${LIBDIR}/plymouth/${PLUGIN_NAME}.so ]; then
-   echo "${LIBDIR}/plymouth/default.so links to ${LIBDIR}/plymouth/${PLUGIN_NAME}.so which doesn't exist" > /dev/stderr
-   exit 1;
+   echo "The default plymouth plugin (${PLUGIN_NAME}) doesn't exist" > /dev/stderr
+   exit 1
 fi
 
 install -m755 ${LIBDIR}/plymouth/${PLUGIN_NAME}.so ${INITRDDIR}${LIBDIR}/plymouth
index 925c63356e422e4aaedb6fb7a3d04a4da9a3db90..84586e74f8a6a4a7a412643fe4ba942328725c48 100755 (executable)
@@ -9,7 +9,12 @@ set -e
 [ -z "$BINDIR" ] && BINDIR="/usr/bin"
 
 if [ $# -lt 1 ]; then
-        basename $(readlink ${LIBDIR}/plymouth/default.so) .so
+        PLUGIN_NAME=$(basename $(readlink ${LIBDIR}/plymouth/default.so) .so)
+        if [ -z "$PLUGIN_NAME" ]; then
+                $0 --reset
+                PLUGIN_NAME=$(basename $(readlink ${LIBDIR}/plymouth/default.so) .so)
+        fi
+        [ -n "$PLUGIN_NAME" ] && echo $PLUGIN_NAME || exit 1
         exit $?
 fi