dracut-functions: handle shared objects in find_binary w/o the exec flag

master
Harald Hoyer 2011-02-17 10:48:35 +01:00
parent f63c30d89b
commit 81c6e7fb69
1 changed files with 6 additions and 1 deletions

View File

@ -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