From: Thomas Deutschmann Date: Tue, 14 Apr 2020 17:40:16 +0000 (+0200) Subject: sys-fs/lvm2: runscript: unify $lvm_path handling X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3958b1dd77ce75c3d2077acc62b4babc8419a9e6;p=gentoo.git sys-fs/lvm2: runscript: unify $lvm_path handling Signed-off-by: Thomas Deutschmann --- diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.187 b/sys-fs/lvm2/files/lvm.rc-2.02.187 index daafffd5b28b..1bf8002b9dab 100644 --- a/sys-fs/lvm2/files/lvm.rc-2.02.187 +++ b/sys-fs/lvm2/files/lvm.rc-2.02.187 @@ -71,12 +71,10 @@ start() { # NOTE: Add needed modules for LVM or RAID, etc # to /etc/modules.autoload if needed + lvm_path="$(_get_lvm_path)" - for lvm_path in /bin/lvm /sbin/lvm ; do - [ -x "${lvm_path}" ] && break - done - if [ ! -x "${lvm_path}" ] ; then - eerror "Cannot find lvm binary in /sbin or /bin!" + if [ -z "${lvm_path}" ] ; then + eerror "Failed to find lvm binary in /bin or /sbin!" return 1 fi if [ -z "${CDBOOT}" ] ; then @@ -121,12 +119,9 @@ start_post() { } stop() { - for lvm_path in /bin/lvm /sbin/lvm ; do - [ -x "${lvm_path}" ] && break - done - - if [ ! -x "${lvm_path}" ] ; then - eerror "Cannot find lvm binary in /sbin or /bin!" + lvm_path="$(_get_lvm_path)" + if [ -z "${lvm_path}" ] ; then + eerror "Failed to find lvm binary in /bin or /sbin!" return 1 fi