diff options
author | Ray Strode <rstrode@redhat.com> | 2008-06-11 10:21:18 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2008-06-11 12:03:20 -0400 |
commit | e86a9268dc2a0a429d5ba2e1fd775f36f84646d9 (patch) | |
tree | 2486c750c793e81619665b578f55e2c81396e244 /scripts | |
parent | ec3d0a0e5c816911a9633a9330a2f8e50cebed6c (diff) | |
download | plymouth-e86a9268dc2a0a429d5ba2e1fd775f36f84646d9.tar.gz plymouth-e86a9268dc2a0a429d5ba2e1fd775f36f84646d9.tar.xz plymouth-e86a9268dc2a0a429d5ba2e1fd775f36f84646d9.zip |
Add new plymouth-set-default-plugin script
This script updates which plugin graphical.so points to
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.am | 5 | ||||
-rwxr-xr-x | scripts/plymouth-set-default-plugin | 27 |
2 files changed, 31 insertions, 1 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 7932851..b780f2e 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -3,10 +3,13 @@ noinst_SCRIPTS = new-object.sh initrdscriptdir = $(libexecdir)/plymouth initrdscript_SCRIPTS = plymouth-update-initrd plymouth-populate-initrd +sbinscriptsdir = $(sbindir) +sbinscripts_SCRIPTS = plymouth-set-default-plugin + if ADD_BOOT_ENTRY install-data-hook: PLYMOUTH_LOGO_FILE=$(logofile) $(initrdscriptdir)/plymouth-update-initrd endif -EXTRA_DIST=$(initrdscript_SCRIPTS) $(noinst_SCRIPTS) default.cfg +EXTRA_DIST=$(initrdscript_SCRIPTS) $(sbinscripts_SCRIPTS) $(noinst_SCRIPTS) default.cfg MAINTAINERCLEANFILES = Makefile.in 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) + |