#!/bin/bash [ -z "$DESTDIR" ] || exit 0 set -e [ -z "$LIBEXECDIR" ] && LIBEXECDIR="/usr/libexec" [ -z "$DATADIR" ] && DATADIR="/usr/share" [ -z "$INITRD" ] && INITRD="/boot/initrd-$(/sbin/grubby --default-kernel | sed 's/.*vmlinuz-//g').img" [ -z "$SYSTEMMAP" ] && SYSTEM_MAP="/boot/System.map-$(/bin/uname -r)" [ -z "$LIB" ] && $(echo nash-showelfinterp /usr/bin/plymouth | /sbin/nash --forcequiet | grep -q lib64) && LIB="lib64" || LIB="lib" [ -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@" if [ -z "$NEW_INITRD" ]; then NEW_INITRD="$(dirname $INITRD)/$(basename $INITRD .img)-plymouth.img" fi function get_lib_deps() { while [ $# -gt 0 ]; do /usr/bin/ldd $1 | sed -n 's/.*=> \?\([^ ]*\) (.*$/\1/p' shift done | sort -u } TMPDIR="$(mktemp -d $PWD/initrd.XXXXXXXXXX)" (cd $TMPDIR zcat $INITRD | cpio --quiet -Hnewc -i --make-directories sed -i -e 's@mknod /dev/ttyS3 c 4 67@&\nmknod /dev/fb c 29 0\nmknod /dev/fb0 c 29 0\ndaemonize /bin/plymouthd\n/bin/plymouth --show-splash\n@' init sed -i -e 's@switchroot@&\n/bin/plymouth --newroot /sysroot\n&\n@' init (cd $LIBDIR DEPS=$(get_lib_deps ${LIBEXECDIR}/plymouth/plymouthd ${BINDIR}/plymouth ${LIBDIR}/plymouth/spinfinity.so ${LIBDIR}/plymouth/text.so ${LIBDIR}/plymouth/details.so) for dep in $DEPS; do install -D -m755 $dep ${TMPDIR}$(dirname $dep) done ) /sbin/ldconfig -n $LIB /sbin/ldconfig -n .${LIBDIR} install -m755 ${LIBEXECDIR}/plymouth/plymouthd bin install -m755 ${BINDIR}/plymouth bin mkdir -p ${TMPDIR}${DATADIR}/plymouth/spinfinity install -m644 ${DATADIR}/plymouth/spinfinity/lock.png ${TMPDIR}${DATADIR}/plymouth/spinfinity install -m644 ${DATADIR}/plymouth/spinfinity/entry.png ${TMPDIR}${DATADIR}/plymouth/spinfinity install -m644 ${DATADIR}/plymouth/spinfinity/bullet.png ${TMPDIR}${DATADIR}/plymouth/spinfinity install -m644 ${DATADIR}/plymouth/spinfinity/box.png ${TMPDIR}${DATADIR}/plymouth/spinfinity install -m644 ${DATADIR}/plymouth/spinfinity/throbber-[0-3][0-9].png ${TMPDIR}${DATADIR}/plymouth/spinfinity mkdir -p ${TMPDIR}${LIBDIR}/plymouth install -m755 ${LIBDIR}/plymouth/spinfinity.so ${TMPDIR}${LIBDIR}/plymouth install -m755 ${LIBDIR}/plymouth/text.so ${TMPDIR}${LIBDIR}/plymouth install -m755 ${LIBDIR}/plymouth/details.so ${TMPDIR}${LIBDIR}/plymouth install -D -m644 ${PLYMOUTH_LOGO_FILE} ${TMPDIR}${PLYMOUTH_LOGO_FILE} rm -f $NEW_INITRD find | cpio --quiet -Hnewc -o | gzip -9 > $NEW_INITRD [ $? -eq 0 ] && echo "Wrote $NEW_INITRD" ) rm -rf "$TMPDIR" # XXX: Hack to clean out old entry since grubby doesn't deal with dupes too well if fgrep -q "title $GRUB_MENU_TITLE" /etc/grub.conf; then TMPFILE="$(mktemp /etc/grub.conf.XXXXXXXXXX)" if [ -L /etc/grub.conf ]; then GRUB_CONF="$(readlink /etc/grub.conf)" else GRUB_CONF="/etc/grub.conf" fi (cd /etc; awk '$1 != "'"$GRUB_MENU_TITLE"'" { printf $0 RT }' RS="title " FS="\n" $GRUB_CONF > $TMPFILE \ && mv $TMPFILE $GRUB_CONF || rm -f $TMPFILE) fi CURRENT_KERNEL=$(/sbin/grubby --default-kernel) /sbin/grubby --title="$GRUB_MENU_TITLE" \ --add-kernel="$CURRENT_KERNEL" \ --copy-default \ --args="vga=0x318 rhgb quiet" \ --initrd="$NEW_INITRD"