plymouth/0001-populate-initrd-Try-to-find-inst-more-aggressively.patch
2009-09-09 16:51:16 +00:00

63 lines
2.0 KiB
Diff

From 736822e2f273596e0a7179f5384002903be3d3db Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Wed, 9 Sep 2009 11:26:46 -0400
Subject: [PATCH] [populate-initrd] Try to find inst more aggressively
We've been using the inst function provided by mkinitrd
to install plymouth and its dependencies into the initrd
root, but mkinitrd may not be installed in a dracut world,
and dracut has its own inst function.
This commit tries getting access to either of them, before
bailing. At some point we may want to bundle our own inst
function or get a new flag added to /usr/bin/install to do
what inst does.
---
scripts/plymouth-populate-initrd.in | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/scripts/plymouth-populate-initrd.in b/scripts/plymouth-populate-initrd.in
index 3857197..dd502b9 100755
--- a/scripts/plymouth-populate-initrd.in
+++ b/scripts/plymouth-populate-initrd.in
@@ -8,10 +8,23 @@
[ -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
+if [ -z "$PLYMOUTH_POPULATE_SOURCE_FUNCTIONS" ]; then
+
+ if [ -f "${LIBEXECDIR}/initrd-functions" ]; then
+ PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="${LIBEXECDIR}/initrd-functions"
+ fi
+
+ if [ -f "${DATADIR}/dracut/dracut-functions" ]; then
+ PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="${DATADIR}/dracut/dracut-functions"
+ fi
+fi
+
+if [ -n "$PLYMOUTH_POPULATE_SOURCE_FUNCTIONS" ]; then
+ source $PLYMOUTH_POPULATE_SOURCE_FUNCTIONS
+fi
+
+if [ " $(type -t inst) " != " function " ]; then
+ echo "Need 'inst' function, try setting PLYMOUTH_POPULATE_SOURCE_FUNCTIONS to a file that defines it" 1>&2
exit 1
fi
@@ -48,7 +61,7 @@ while [ $# -gt 0 ]; do
esac
shift
done
-set_verbose $verbose
+set_verbose $verbose || :
[ -z "$INITRDDIR" ] && usage error
--
1.6.4.2