From: Harald Hoyer Date: Thu, 17 Feb 2011 09:48:35 +0000 (+0100) Subject: dracut-functions: handle shared objects in find_binary w/o the exec flag X-Git-Tag: 009~123 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=81c6e7fb69a0b7ef5169d13f8b4a4025db923ead;p=thirdparty%2Fdracut.git dracut-functions: handle shared objects in find_binary w/o the exec flag --- diff --git a/dracut-functions b/dracut-functions index eef8f1ed2..ebcb7d8fb 100755 --- a/dracut-functions +++ b/dracut-functions @@ -320,7 +320,12 @@ inst_library() { # search in the usual places to find the binary. find_binary() { local binpath="/bin /sbin /usr/bin /usr/sbin" p - [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } + if [[ -z ${1##/*} ]]; then + if [[ -x $1 ]] || ldd $1 &>/dev/null; then + echo $1 + return 0 + fi + fi for p in $binpath; do [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; } done