summaryrefslogtreecommitdiffstats
path: root/scripts/plymouth-set-default-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/plymouth-set-default-plugin')
-rwxr-xr-xscripts/plymouth-set-default-plugin27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/plymouth-set-default-plugin b/scripts/plymouth-set-default-plugin
new file mode 100755
index 0000000..42a0266
--- /dev/null
+++ b/scripts/plymouth-set-default-plugin
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+set -e
+
+[ -z "$LIBEXECDIR" ] && LIBEXECDIR="/usr/libexec"
+[ -z "$DATADIR" ] && DATADIR="/usr/share"
+[ -z "$LIB" ] && $(eu-readelf -h /usr/bin/plymouth | grep Class | grep -q ELF64) && LIB="lib64" || LIB="lib"
+[ -z "$LIBDIR" ] && LIBDIR="/usr/$LIB"
+[ -z "$BINDIR" ] && BINDIR="/usr/bin"
+
+if [ $# -lt 1 ]; then
+ basename $(readlink ${LIBDIR}/plymouth/graphical.so) .so
+ exit $?
+fi
+
+if [ `id -u` -ne 0 ]; then
+ echo "This program must be run as root" > /dev/stderr
+ exit 1
+fi
+
+if [ ! -e ${LIBDIR}/plymouth/$1.so ]; then
+ echo "${LIBDIR}/plymouth/$1.so does not exist" > /dev/stderr
+ exit 1
+fi
+
+(cd ${LIBDIR}/plymouth; ln -sf $1 graphical.so)
+