aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2020-08-28 14:39:38 +0200
committerThomas Deutschmann <whissi@gentoo.org>2020-08-28 15:45:38 +0200
commit0b378bf0d675188a438bfea9dee392fb2b5d0cfd (patch)
treed837318d083e16b04c55df61bcbcf7a330dc9880
parentgen_initramfs.sh: append_base_layout(): move /run/utmp to /var/run/utmp (diff)
downloadgenkernel-0b378bf0.tar.gz
genkernel-0b378bf0.tar.bz2
genkernel-0b378bf0.zip
defaults/linuxrc: Make use of PATH (2)
Don't use absolute paths. Use 'hash' to test if command is available. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rw-r--r--defaults/linuxrc7
1 files changed, 4 insertions, 3 deletions
diff --git a/defaults/linuxrc b/defaults/linuxrc
index 466e1f7..5c3b0ce 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -509,15 +509,16 @@ esac
# Verify that it is safe to use ZFS
if [ "${USE_ZFS}" = '1' ]
then
- for i in /sbin/zfs /sbin/zpool
+ for i in zfs zpool
do
- if [ ! -x ${i} ]
+ if ! hash ${i} >/dev/null 2>&1
then
USE_ZFS=0
- bad_msg "Aborting use of ZFS because ${i} not found!"
+ bad_msg "Aborting use of ZFS because '${i}' not found!"
break
fi
done
+ unset i
[ "${USE_ZFS}" = '1' ] && MY_HWOPTS="${MY_HWOPTS} zfs"
fi