From 5ea0be0a8c83969fd0041b3e647f82fcfb365e44 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 8 Jul 2014 12:54:21 +0200 Subject: [PATCH] dracut-functions.sh: speed up ldconfig_paths() --- dracut-functions.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dracut-functions.sh b/dracut-functions.sh index d30e835..9f481b2 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -109,12 +109,11 @@ 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 - printf "%s\n" ${d%/*}; + ldconfig -pN 2>/dev/null | grep -F '=>' | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | while read a b c d; do + d=${d%/*} + printf "%s\n" "$d"; done ); do - [[ "$i" = "/lib" || "$i" = "/usr/lib" || "$i" = "/lib64" || "$i" = "/usr/lib64" ]] && continue a["$i"]=1; done; printf "%s\n" ${!a[@]}