diff options
author | Harald Hoyer <harald@redhat.com> | 2013-08-13 20:00:55 +0200 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2013-08-14 15:04:05 +0200 |
commit | 4fe1bdd406602922a55ef4f7d6a13e13dfd1b87f (patch) | |
tree | 35d5111f87b651d9cab9783775c977733fa30f36 | |
parent | a13bf117d52a5c950038237079aee4a645387b56 (diff) | |
download | dracut-4fe1bdd406602922a55ef4f7d6a13e13dfd1b87f.tar.gz dracut-4fe1bdd406602922a55ef4f7d6a13e13dfd1b87f.tar.bz2 dracut-4fe1bdd406602922a55ef4f7d6a13e13dfd1b87f.zip |
dracut-functions.sh: if no libdirs are set, take the ld.so.cache paths
-rwxr-xr-x | dracut-functions.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/dracut-functions.sh b/dracut-functions.sh index 6033a1a2..ec31cf15 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -55,6 +55,21 @@ if ! [[ $dracutbasedir ]]; then dracutbasedir="$(readlink -f $dracutbasedir)" 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 if ! [[ $libdirs ]] ; then if [[ "$(ldd /bin/sh)" == */lib64/* ]] &>/dev/null \ @@ -65,6 +80,9 @@ if ! [[ $libdirs ]] ; then libdirs+=" /lib" [[ -d /usr/lib ]] && libdirs+=" /usr/lib" fi + + libdirs+="$(ldconfig_paths)" + export libdirs fi |