dracut/0005-dracut-functions-handle-shared-objects-in-find_binar.patch
Harald Hoyer 0260fa5e6c - fixed i18n
- turned off selinux by default
2011-02-18 09:49:51 +01:00

28 lines
908 B
Diff

From 81c6e7fb69a0b7ef5169d13f8b4a4025db923ead Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 17 Feb 2011 10:48:35 +0100
Subject: [PATCH] dracut-functions: handle shared objects in find_binary w/o the exec flag
---
dracut-functions | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/dracut-functions b/dracut-functions
index eef8f1e..ebcb7d8 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