summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2007-10-19 14:00:47 -0400
committerRay Strode <rstrode@redhat.com>2007-10-19 14:00:47 -0400
commitac1e206825516e386c38224f98c97ea0468842e9 (patch)
tree10689de7aee2b45835d9392f36272aa826fa3a3e /scripts
parent390d7b883aa862751f8746b50faee8d5ee383df4 (diff)
downloadplymouth-ac1e206825516e386c38224f98c97ea0468842e9.tar.gz
plymouth-ac1e206825516e386c38224f98c97ea0468842e9.tar.xz
plymouth-ac1e206825516e386c38224f98c97ea0468842e9.zip
Clean up old plymouth entries before running grubby, since dupes confuse it
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/plymouth-update-initrd17
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/plymouth-update-initrd b/scripts/plymouth-update-initrd
index ed464fa..724ec3f 100755
--- a/scripts/plymouth-update-initrd
+++ b/scripts/plymouth-update-initrd
@@ -10,6 +10,7 @@ set -e
[ -z "$SYSTEMMAP" ] && SYSTEM_MAP="/boot/System.map-$(/bin/uname -r)"
[ -z "$LIB" ] && [ $(head -n1 $SYSTEM_MAP | awk '{print $1}' | wc -c) -lt 16 ] && LIB="lib" || LIB="lib64"
[ -z "$LIBDIR" ] && LIBDIR="/usr/$LIB"
+[ -z "$GRUB_MENU_TITLE" ] && GRUB_MENU_TITLE="Graphical Bootup"
if [ -z "$NEW_INITRD" ]; then
NEW_INITRD="$(dirname $INITRD)/$(basename $INITRD .img)-plymouth.img"
@@ -36,7 +37,7 @@ TMPDIR="$(mktemp -d $PWD/initrd.XXXXXXXXXX)"
done
)
/sbin/ldconfig -n $LIB
- /sbin/ldconfig -n ./$LIBDIR
+ /sbin/ldconfig -n .${LIBDIR}
install -m755 ${LIBEXECDIR}/plymouth/plymouth bin
@@ -57,7 +58,19 @@ rm -rf "$TMPDIR"
CURRENT_KERNEL=$(/sbin/grubby --default-kernel)
-/sbin/grubby --title="Graphical Bootup" \
+# 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
+ awk '$1 != "'"$GRUB_MENU_TITLE"'" { printf $0 RT }' RS="title " FS="\n" $GRUB_CONF > $TMPFILE \
+ && mv $TMPFILE $GRUB_CONF || rm -f $TMPFILE
+fi
+
+/sbin/grubby --title="$GRUB_MENU_TITLE" \
--add-kernel="$CURRENT_KERNEL" \
--copy-default \
--args="vga=0x318 rhgb quiet" \