]> granicus.if.org Git - zfs/commitdiff
Replace whereis with type in zfs-lib.sh
authordacianstremtan <35844628+dacianstremtan@users.noreply.github.com>
Thu, 20 Jun 2019 19:27:14 +0000 (15:27 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 20 Jun 2019 19:27:14 +0000 (12:27 -0700)
The whereis command should not be used since it may not exist
in the initramfs.  The dracut plymouth module also uses the type
command instead of whereis.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Garrett Fields <ghfields@gmail.com>
Signed-off-by: Dacian Reece-Stremtan <dacianstremtan@gmail.com>
Closes #8920
Closes #8938

contrib/dracut/90zfs/zfs-lib.sh.in

index 23c07af9e86f4962c052dc8d2529aa1d63541904..44021c6e5fc1085387d54ba2d6b63364573ef739 100755 (executable)
@@ -144,7 +144,7 @@ ask_for_password() {
 
     { flock -s 9;
         # Prompt for password with plymouth, if installed and running.
-        if whereis plymouth >/dev/null 2>&1 && plymouth --ping 2>/dev/null; then
+        if type plymouth >/dev/null 2>&1 && plymouth --ping 2>/dev/null; then
             plymouth ask-for-password \
                 --prompt "$ply_prompt" --number-of-tries="$ply_tries" \
                 --command="$ply_cmd"