You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
2.7 KiB
101 lines
2.7 KiB
#!/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="@logofile@"
|
|
[ -z "$PLYMOUTH_THEME_NAME" ] && PLYMOUTH_THEME_NAME=$(plymouth-set-default-theme)
|
|
|
|
if [ -f "${LIBEXECDIR}/initrd-functions" ]; then
|
|
. "${LIBEXECDIR}/initrd-functions"
|
|
else
|
|
echo "Couldn't import initrd functions." > /dev/stderr
|
|
exit 1
|
|
fi
|
|
|
|
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
|
|
set_verbose $verbose
|
|
|
|
[ -z "$INITRDDIR" ] && usage error
|
|
|
|
mkdir -p ${INITRDDIR}${DATADIR}/plymouth/themes
|
|
inst /sbin/plymouthd $INITRDDIR /bin/plymouthd
|
|
inst /bin/plymouth $INITRDDIR
|
|
inst ${DATADIR}/plymouth/themes/text/text.plymouth $INITRDDIR
|
|
inst ${LIBDIR}/plymouth/text.so $INITRDDIR
|
|
inst ${DATADIR}/plymouth/themes/details/details.plymouth $INITRDDIR
|
|
inst ${LIBDIR}/plymouth/details.so $INITRDDIR
|
|
inst ${PLYMOUTH_LOGO_FILE} $INITRDDIR
|
|
inst @RELEASE_FILE@ $INITRDDIR
|
|
|
|
if [ -z "$PLYMOUTH_THEME_NAME" ]; then
|
|
echo "No default plymouth plugin is set" > /dev/stderr
|
|
exit 1
|
|
fi
|
|
|
|
PLYMOUTH_MODULE_NAME=$(grep "ModuleName *= *" ${DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}/${PLYMOUTH_THEME_NAME}.plymouth | sed 's/ModuleName *= *//')
|
|
|
|
if [ ! -f ${LIBDIR}/plymouth/${PLYMOUTH_MODULE_NAME}.so ]; then
|
|
echo "The default plymouth plugin (${PLYMOUTH_MODULE_NAME}) doesn't exist" > /dev/stderr
|
|
exit 1
|
|
fi
|
|
|
|
inst ${LIBDIR}/plymouth/${PLYMOUTH_MODULE_NAME}.so $INITRDDIR
|
|
|
|
if [ -d ${DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME} ]; then
|
|
for x in ${DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}/* ; do
|
|
[ ! -f "$x" ] && break
|
|
inst $x $INITRDDIR
|
|
done
|
|
fi
|
|
|
|
if [ -L ${DATADIR}/plymouth/themes/default.plymouth ]; then
|
|
cp -a ${DATADIR}/plymouth/themes/default.plymouth $INITRDDIR${DATADIR}/plymouth/themes
|
|
fi
|
|
|
|
# vim:ts=8:sw=4:sts=4:et
|