Blame 0019-Do-not-call-plymouth-with-full-path.patch

Harald Hoyer e787af
From ca2c6936798b3931fb4806d783c17474b8f89878 Mon Sep 17 00:00:00 2001
Harald Hoyer e787af
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer e787af
Date: Thu, 11 Apr 2013 16:08:26 +0200
Harald Hoyer e787af
Subject: [PATCH] Do not call plymouth with full path
Harald Hoyer e787af
Harald Hoyer e787af
---
Harald Hoyer e787af
 modules.d/50plymouth/module-setup.sh             | 2 +-
Harald Hoyer e787af
 modules.d/50plymouth/plymouth-emergency.sh       | 2 +-
Harald Hoyer e787af
 modules.d/50plymouth/plymouth-newroot.sh         | 4 ++--
Harald Hoyer e787af
 modules.d/50plymouth/plymouth-populate-initrd.sh | 5 ++---
Harald Hoyer e787af
 modules.d/50plymouth/plymouth-pretrigger.sh      | 6 +++---
Harald Hoyer e787af
 modules.d/90crypt/crypt-lib.sh                   | 4 ++--
Harald Hoyer e787af
 modules.d/90dmsquash-live/dmsquash-live-root.sh  | 4 ++--
Harald Hoyer e787af
 modules.d/98systemd/dracut-emergency.sh          | 2 +-
Harald Hoyer e787af
 modules.d/99base/dracut-lib.sh                   | 4 ++--
Harald Hoyer e787af
 9 files changed, 16 insertions(+), 17 deletions(-)
Harald Hoyer e787af
Harald Hoyer e787af
diff --git a/modules.d/50plymouth/module-setup.sh b/modules.d/50plymouth/module-setup.sh
Harald Hoyer e787af
index f754e24..ae35b11 100755
Harald Hoyer e787af
--- a/modules.d/50plymouth/module-setup.sh
Harald Hoyer e787af
+++ b/modules.d/50plymouth/module-setup.sh
Harald Hoyer e787af
@@ -4,7 +4,7 @@
Harald Hoyer e787af
 
Harald Hoyer e787af
 check() {
Harald Hoyer e787af
     [[ "$mount_needs" ]] && return 1
Harald Hoyer e787af
-    [[ -x /sbin/plymouthd && -x /bin/plymouth && -x /usr/sbin/plymouth-set-default-theme ]]
Harald Hoyer e787af
+    type -P plymouthd >/dev/null && type -P plymouth >/dev/null
Harald Hoyer e787af
 }
Harald Hoyer e787af
 
Harald Hoyer e787af
 depends() {
Harald Hoyer e787af
diff --git a/modules.d/50plymouth/plymouth-emergency.sh b/modules.d/50plymouth/plymouth-emergency.sh
Harald Hoyer e787af
index 68955b8..ed0b0ac 100755
Harald Hoyer e787af
--- a/modules.d/50plymouth/plymouth-emergency.sh
Harald Hoyer e787af
+++ b/modules.d/50plymouth/plymouth-emergency.sh
Harald Hoyer e787af
@@ -1,4 +1,4 @@
Harald Hoyer e787af
 #!/bin/sh
Harald Hoyer e787af
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
Harald Hoyer e787af
 # ex: ts=8 sw=4 sts=4 et filetype=sh
Harald Hoyer e787af
-[ -x /bin/plymouth ] && /bin/plymouth --hide-splash
Harald Hoyer e787af
+plymouth --hide-splash 2>/dev/null || :
Harald Hoyer e787af
diff --git a/modules.d/50plymouth/plymouth-newroot.sh b/modules.d/50plymouth/plymouth-newroot.sh
Harald Hoyer e787af
index 2311b47..96cd138 100755
Harald Hoyer e787af
--- a/modules.d/50plymouth/plymouth-newroot.sh
Harald Hoyer e787af
+++ b/modules.d/50plymouth/plymouth-newroot.sh
Harald Hoyer e787af
@@ -2,6 +2,6 @@
Harald Hoyer e787af
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
Harald Hoyer e787af
 # ex: ts=8 sw=4 sts=4 et filetype=sh
Harald Hoyer e787af
 
Harald Hoyer e787af
-if [ -x /bin/plymouth -a -z "$DRACUT_SYSTEMD" ]; then
Harald Hoyer e787af
-    /bin/plymouth --newroot=$NEWROOT
Harald Hoyer e787af
+if type plymouth >/dev/null 2>&1 && [ -z "$DRACUT_SYSTEMD" ]; then
Harald Hoyer e787af
+    plymouth --newroot=$NEWROOT
Harald Hoyer e787af
 fi
Harald Hoyer e787af
diff --git a/modules.d/50plymouth/plymouth-populate-initrd.sh b/modules.d/50plymouth/plymouth-populate-initrd.sh
Harald Hoyer e787af
index 1e2ffe7..6e0f561 100755
Harald Hoyer e787af
--- a/modules.d/50plymouth/plymouth-populate-initrd.sh
Harald Hoyer e787af
+++ b/modules.d/50plymouth/plymouth-populate-initrd.sh
Harald Hoyer e787af
@@ -4,15 +4,14 @@
Harald Hoyer e787af
 PLYMOUTH_LOGO_FILE="/usr/share/pixmaps/system-logo-white.png"
Harald Hoyer e787af
 PLYMOUTH_THEME=$(plymouth-set-default-theme)
Harald Hoyer e787af
 
Harald Hoyer e787af
-inst /sbin/plymouthd /bin/plymouthd
Harald Hoyer e787af
-dracut_install /bin/plymouth \
Harald Hoyer e787af
+dracut_install plymouthd plymouth \
Harald Hoyer e787af
     "${PLYMOUTH_LOGO_FILE}" \
Harald Hoyer e787af
     /etc/system-release
Harald Hoyer e787af
 
Harald Hoyer e787af
 mkdir -m 0755 -p "${initdir}/usr/share/plymouth"
Harald Hoyer e787af
 
Harald Hoyer e787af
 inst_libdir_file "plymouth/text.so" "plymouth/details.so"
Harald Hoyer e787af
-    
Harald Hoyer e787af
+
Harald Hoyer e787af
 if [[ $hostonly ]]; then
Harald Hoyer e787af
     dracut_install \
Harald Hoyer e787af
         "/usr/share/plymouth/themes/details/details.plymouth" \
Harald Hoyer e787af
diff --git a/modules.d/50plymouth/plymouth-pretrigger.sh b/modules.d/50plymouth/plymouth-pretrigger.sh
Harald Hoyer e787af
index 0e3cb02..8087bf6 100755
Harald Hoyer e787af
--- a/modules.d/50plymouth/plymouth-pretrigger.sh
Harald Hoyer e787af
+++ b/modules.d/50plymouth/plymouth-pretrigger.sh
Harald Hoyer e787af
@@ -2,7 +2,7 @@
Harald Hoyer e787af
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
Harald Hoyer e787af
 # ex: ts=8 sw=4 sts=4 et filetype=sh
Harald Hoyer e787af
 
Harald Hoyer e787af
-if [ -x /bin/plymouthd -a -z "$DRACUT_SYSTEMD" ]; then
Harald Hoyer e787af
+if type plymouthd >/dev/null 2>&1 && [-z "$DRACUT_SYSTEMD" ]; then
Harald Hoyer e787af
     if getargbool 1 plymouth.enable && getargbool 1 rd.plymouth -d -n rd_NO_PLYMOUTH; then
Harald Hoyer e787af
         # first trigger graphics subsystem
Harald Hoyer e787af
         udevadm trigger --action=add --attr-match=class=0x030000 >/dev/null 2>&1
Harald Hoyer e787af
@@ -16,8 +16,8 @@ if [ -x /bin/plymouthd -a -z "$DRACUT_SYSTEMD" ]; then
Harald Hoyer e787af
         read consoledev rest < /sys/class/tty/console/active
Harald Hoyer e787af
         consoledev=${consoledev:-tty0}
Harald Hoyer e787af
         [ -x /lib/udev/console_init -a -e "/dev/$consoledev" ] && /lib/udev/console_init "/dev/$consoledev"
Harald Hoyer e787af
-        [ -x /bin/plymouthd ] && /bin/plymouthd --attach-to-session --pid-file /run/plymouth/pid
Harald Hoyer e787af
-        /bin/plymouth --show-splash 2>&1 | vinfo
Harald Hoyer e787af
+        plymouthd --attach-to-session --pid-file /run/plymouth/pid
Harald Hoyer e787af
+        plymouth --show-splash 2>&1 | vinfo
Harald Hoyer e787af
         # reset tty after plymouth messed with it
Harald Hoyer e787af
         [ -x /lib/udev/console_init -a -e "/dev/$consoledev" ] && /lib/udev/console_init "/dev/$consoledev"
Harald Hoyer e787af
     fi
Harald Hoyer e787af
diff --git a/modules.d/90crypt/crypt-lib.sh b/modules.d/90crypt/crypt-lib.sh
Harald Hoyer e787af
index d66ba88..ebe09f8 100755
Harald Hoyer e787af
--- a/modules.d/90crypt/crypt-lib.sh
Harald Hoyer e787af
+++ b/modules.d/90crypt/crypt-lib.sh
Harald Hoyer e787af
@@ -47,8 +47,8 @@ ask_for_password() {
Harald Hoyer e787af
 
Harald Hoyer e787af
     { flock -s 9;
Harald Hoyer e787af
         # Prompt for password with plymouth, if installed and running.
Harald Hoyer e787af
-        if [ -x /bin/plymouth ] && /bin/plymouth --ping; then
Harald Hoyer e787af
-            /bin/plymouth ask-for-password \
Harald Hoyer e787af
+        if type plymouth >/dev/null 2>&1 && plymouth --ping 2>/dev/null; then
Harald Hoyer e787af
+            plymouth ask-for-password \
Harald Hoyer e787af
                 --prompt "$ply_prompt" --number-of-tries=$ply_tries \
Harald Hoyer e787af
                 --command="$ply_cmd"
Harald Hoyer e787af
             ret=$?
Harald Hoyer e787af
diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh
Harald Hoyer e787af
index a79b0d9..07e41f0 100755
Harald Hoyer e787af
--- a/modules.d/90dmsquash-live/dmsquash-live-root.sh
Harald Hoyer e787af
+++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh
Harald Hoyer e787af
@@ -31,7 +31,7 @@ if [ "$fs" = "iso9660" -o "$fs" = "udf" ]; then
Harald Hoyer e787af
 fi
Harald Hoyer e787af
 getarg rd.live.check -d check || check=""
Harald Hoyer e787af
 if [ -n "$check" ]; then
Harald Hoyer e787af
-    [ -x /bin/plymouth ] && /bin/plymouth --hide-splash
Harald Hoyer e787af
+    type plymouth >/dev/null 2>&1 && plymouth --hide-splash
Harald Hoyer e787af
     if [ -n "$DRACUT_SYSTEMD" ]; then
Harald Hoyer e787af
         p=$(str_replace "$livedev" "-" '\x2d')
Harald Hoyer e787af
         systemctl start checkisomd5@${p}.service
Harald Hoyer e787af
@@ -42,7 +42,7 @@ if [ -n "$check" ]; then
Harald Hoyer e787af
         die "CD check failed!"
Harald Hoyer e787af
         exit 1
Harald Hoyer e787af
     fi
Harald Hoyer e787af
-    [ -x /bin/plymouth ] && /bin/plymouth --show-splash
Harald Hoyer e787af
+    type plymouth >/dev/null 2>&1 && plymouth --show-splash
Harald Hoyer e787af
 fi
Harald Hoyer e787af
 
Harald Hoyer e787af
 ln -s $livedev /run/initramfs/livedev
Harald Hoyer e787af
diff --git a/modules.d/98systemd/dracut-emergency.sh b/modules.d/98systemd/dracut-emergency.sh
Harald Hoyer e787af
index a0a4b12..8ab045e 100755
Harald Hoyer e787af
--- a/modules.d/98systemd/dracut-emergency.sh
Harald Hoyer e787af
+++ b/modules.d/98systemd/dracut-emergency.sh
Harald Hoyer e787af
@@ -10,7 +10,7 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
Harald Hoyer e787af
 
Harald Hoyer e787af
 source_conf /etc/conf.d
Harald Hoyer e787af
 
Harald Hoyer e787af
-[ -x /bin/plymouth ] && /bin/plymouth quit
Harald Hoyer e787af
+type plymouth >/dev/null 2>&1 && plymouth quit
Harald Hoyer e787af
 
Harald Hoyer e787af
 export _rdshell_name="dracut" action="Boot" hook="emergency"
Harald Hoyer e787af
 
Harald Hoyer e787af
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
Harald Hoyer e787af
index 1defb6f..9f4b2d2 100755
Harald Hoyer e787af
--- a/modules.d/99base/dracut-lib.sh
Harald Hoyer e787af
+++ b/modules.d/99base/dracut-lib.sh
Harald Hoyer e787af
@@ -971,8 +971,8 @@ emergency_shell()
Harald Hoyer e787af
         shift 2
Harald Hoyer e787af
     elif [ "$1" = "--shutdown" ]; then
Harald Hoyer e787af
         _rdshell_name=$2; action="Shutdown"; hook="shutdown-emergency"
Harald Hoyer e787af
-        if [ -x /bin/plymouth ]; then
Harald Hoyer e787af
-            /bin/plymouth --hide-splash
Harald Hoyer e787af
+        if type plymouth >/dev/null 2>&1; then
Harald Hoyer e787af
+            plymouth --hide-splash
Harald Hoyer e787af
         elif [ -x /oldroot/bin/plymouth ]; then
Harald Hoyer e787af
             /oldroot/bin/plymouth --hide-splash
Harald Hoyer e787af
         fi