#!/bin/bash
-
-[ -z "$DESTDIR" ] || exit 0
-
-[ -z "$LIBEXECDIR" ] && LIBEXECDIR="/usr/libexec"
-[ -z "$DATADIR" ] && DATADIR="/usr/share"
-[ -z "$SYSTEMMAP" ] && SYSTEM_MAP="/boot/System.map-$(/bin/uname -r)"
-if [ -z "$LIB" ]; then
- if $(echo nash-showelfinterp /proc/$$/exe | /sbin/nash --forcequiet | grep -q lib64); then
- LIB="lib64"
- else
- LIB="lib"
- fi
-fi
-[ -z "$LIBDIR" ] && LIBDIR="/usr/$LIB"
-[ -z "$BINDIR" ] && BINDIR="/usr/bin"
-[ -z "$GRUB_MENU_TITLE" ] && GRUB_MENU_TITLE="Graphical Bootup"
-[ -z "$PLYMOUTH_LOGO_FILE" ] && PLYMOUTH_LOGO_FILE="/usr/share/pixmaps/system-logo-white.png"
-[ -z "$PLYMOUTH_PLUGIN_NAME" ] && PLYMOUTH_PLUGIN_NAME=$(plymouth-set-default-plugin)
-
-function usage() {
- local output="/dev/stdout"
- local rc=0
- if [ "$1" == "error" ]; then
- output="/dev/stderr"
- rc=1
- fi
-
- echo "usage: plymouth [ --verbose | -v ] { --targetdir | -t } <initrd_directory>" > $output
- exit $rc
-}
-
-verbose=false
-INITRDDIR=""
-while [ $# -gt 0 ]; do
- case $1 in
- --verbose|-v)
- verbose=true
- ;;
- --targetdir|-t)
- shift
- INITRDDIR="$1"
- ;;
- --help|-h)
- usage normal
- ;;
- *)
- usage error
- break
- ;;
- esac
- shift
-done
-
-[ -z "$INITRDDIR" ] && usage error
-
-inst /sbin/plymouthd $INITRDDIR /bin/plymouthd
-inst /bin/plymouth $INITRDDIR
-inst ${LIBDIR}/plymouth/text.so $INITRDDIR
-inst ${LIBDIR}/plymouth/details.so $INITRDDIR
-inst ${PLYMOUTH_LOGO_FILE} $INITRDDIR
-inst /etc/system-release $INITRDDIR
-mkdir -p ${INITRDDIR}${DATADIR}/plymouth
-
-if [ -z "$PLYMOUTH_PLUGIN_NAME" ]; then
- echo "No default plymouth plugin is set" > /dev/stderr
- exit 1
+if ldd /proc/$$/exe |grep -q lib64; then
+ LIBDIR="/usr/lib64"
+else
+ LIBDIR="/usr/lib"
fi
+PLYMOUTH_LOGO_FILE="/usr/share/pixmaps/system-logo-white.png"
+PLYMOUTH_PLUGIN_NAME=$(plymouth-set-default-plugin)
-if [ ! -f ${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN_NAME}.so ]; then
- echo "The default plymouth plugin (${PLYMOUTH_PLUGIN_NAME}) doesn't exist" > /dev/stderr
- exit 1
-fi
-
-inst ${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN_NAME}.so $INITRDDIR
+inst /sbin/plymouthd /bin/plymouthd
+dracut_install /bin/plymouth "${LIBDIR}/plymouth/text.so" \
+ "${LIBDIR}/plymouth/details.so" "${PLYMOUTH_LOGO_FILE}" \
+ /etc/system-release "${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN_NAME:=text}.so"
+mkdir -p "${initdir}/usr/share/plymouth"
-if [ -f ${LIBDIR}/plymouth/default.so ]; then
- inst ${LIBDIR}/plymouth/default.so $INITRDDIR
-fi
+[[ -f ${LIBDIR}/plymouth/default.so ]] && inst ${LIBDIR}/plymouth/default.so
-if [ -d ${DATADIR}/plymouth/${PLYMOUTH_PLUGIN_NAME} ]; then
- for x in ${DATADIR}/plymouth/${PLYMOUTH_PLUGIN_NAME}/* ; do
- [ ! -f "$x" ] && break
- inst $x $INITRDDIR
+if [[ -d /usr/share/plymouth/${PLYMOUTH_PLUGIN_NAME} ]]; then
+ for x in "/usr/share/plymouth/${PLYMOUTH_PLUGIN_NAME}"/* ; do
+ [[ -f "$x" ]] || break
+ inst $x
done
fi