From 8f7cf9a139170417a2e3e5dba67266e16bcc33c4 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 17 Oct 2008 15:49:31 -0400 Subject: [PATCH] Gut plymouth-update-initrd It's broken and people keep using it, so change it so that it's useful. --- .gitignore | 1 - scripts/Makefile.am | 9 ++-- scripts/plymouth-update-initrd | 2 + scripts/plymouth-update-initrd.in | 87 ------------------------------- 4 files changed, 5 insertions(+), 94 deletions(-) create mode 100755 scripts/plymouth-update-initrd delete mode 100755 scripts/plymouth-update-initrd.in diff --git a/.gitignore b/.gitignore index 301a45af..16882ad2 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,6 @@ aclocal.m4 stamp-* *.rpm plymouth -plymouth-update-initrd plymouth-populate-initrd plymouthd *.pc diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 6536fa13..bcd04de4 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -6,9 +6,6 @@ initrdscript_SCRIPTS = plymouth-update-initrd plymouth-populate-initrd sbinscriptsdir = $(sbindir) sbinscripts_SCRIPTS = plymouth-set-default-plugin -plymouth-update-initrd: $(srcdir)/plymouth-update-initrd.in - sed -e 's,[@]logofile[@],$(logofile),g' $(srcdir)/plymouth-update-initrd.in > plymouth-update-initrd - plymouth-populate-initrd: $(srcdir)/plymouth-populate-initrd.in sed -e 's,[@]logofile[@],$(logofile),g' \ -e 's,[@]plymouthclientdir[@],$(plymouthclientdir),g' \ @@ -21,11 +18,11 @@ plymouth-set-default-plugin: $(srcdir)/plymouth-set-default-plugin.in -e 's,[@]plymouthdaemondir[@],$(plymouthdaemondir),g' \ $(srcdir)/plymouth-set-default-plugin.in > plymouth-set-default-plugin -EXTRA_DIST= plymouth-update-initrd.in \ +EXTRA_DIST= plymouth-update-initrd \ plymouth-populate-initrd.in \ plymouth-set-default-plugin.in \ $(noinst_SCRIPTS) \ default.cfg -CLEANFILES = plymouth-update-initrd plymouth-populate-initrd plymouth-set-default-plugin -MAINTAINERCLEANFILES = Makefile.in plymouth-update-initrd plymouth-populate-initrd plymouth-set-default-plugin +CLEANFILES = plymouth-populate-initrd plymouth-set-default-plugin +MAINTAINERCLEANFILES = Makefile.in plymouth-populate-initrd plymouth-set-default-plugin diff --git a/scripts/plymouth-update-initrd b/scripts/plymouth-update-initrd new file mode 100755 index 00000000..1403b8b6 --- /dev/null +++ b/scripts/plymouth-update-initrd @@ -0,0 +1,2 @@ +#!/bin/bash +mkinitrd -f /boot/initrd-$(uname -r).img $(uname -r) diff --git a/scripts/plymouth-update-initrd.in b/scripts/plymouth-update-initrd.in deleted file mode 100755 index b8bc8f8c..00000000 --- a/scripts/plymouth-update-initrd.in +++ /dev/null @@ -1,87 +0,0 @@ -#!/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" -- 2.47.3