dracut-functions.sh: if no libdirs are set, take the ld.so.cache paths

master
Harald Hoyer 2013-08-13 20:00:55 +02:00
parent a13bf117d5
commit 4fe1bdd406
1 changed files with 18 additions and 0 deletions

View File

@ -55,6 +55,21 @@ if ! [[ $dracutbasedir ]]; then
dracutbasedir="$(readlink -f $dracutbasedir)" dracutbasedir="$(readlink -f $dracutbasedir)"
fi fi


ldconfig_paths()
{
local a i
declare -A a
for i in $(
ldconfig -pN 2>/dev/null | while read a b c d; do
[[ "$c" != "=>" ]] && continue
echo ${d%/*};
done
); do
a["$i"]=1;
done;
printf "%s\n" ${!a[@]}
}

# Detect lib paths # Detect lib paths
if ! [[ $libdirs ]] ; then if ! [[ $libdirs ]] ; then
if [[ "$(ldd /bin/sh)" == */lib64/* ]] &>/dev/null \ if [[ "$(ldd /bin/sh)" == */lib64/* ]] &>/dev/null \
@ -65,6 +80,9 @@ if ! [[ $libdirs ]] ; then
libdirs+=" /lib" libdirs+=" /lib"
[[ -d /usr/lib ]] && libdirs+=" /usr/lib" [[ -d /usr/lib ]] && libdirs+=" /usr/lib"
fi fi

libdirs+="$(ldconfig_paths)"

export libdirs export libdirs
fi fi