a56a5e
From 8bf70609de708380c1184bb27a561f6f253650b6 Mon Sep 17 00:00:00 2001
a56a5e
From: Harald Hoyer <harald@redhat.com>
a56a5e
Date: Tue, 8 Jul 2014 12:54:21 +0200
a56a5e
Subject: [PATCH] dracut-functions.sh: speed up ldconfig_paths()
a56a5e
a56a5e
(cherry picked from commit 5ea0be0a8c83969fd0041b3e647f82fcfb365e44)
a56a5e
---
a56a5e
 dracut-functions.sh | 7 +++----
a56a5e
 1 file changed, 3 insertions(+), 4 deletions(-)
a56a5e
a56a5e
diff --git a/dracut-functions.sh b/dracut-functions.sh
1755ca
index 915f70fa..00025567 100755
a56a5e
--- a/dracut-functions.sh
a56a5e
+++ b/dracut-functions.sh
a56a5e
@@ -60,12 +60,11 @@ ldconfig_paths()
a56a5e
     local a i
a56a5e
     declare -A a
a56a5e
     for i in $(
a56a5e
-        ldconfig -pN 2>/dev/null | while read a b c d; do
a56a5e
-            [[ "$c" != "=>" ]] && continue
a56a5e
-            printf "%s\n" ${d%/*};
a56a5e
+        ldconfig -pN 2>/dev/null | grep -F '=>' | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | while read a b c d; do
a56a5e
+            d=${d%/*}
a56a5e
+            printf "%s\n" "$d";
a56a5e
         done
a56a5e
     ); do
a56a5e
-        [[ "$i" = "/lib" || "$i" = "/usr/lib" || "$i" = "/lib64" || "$i" = "/usr/lib64" ]] && continue
a56a5e
         a["$i"]=1;
a56a5e
     done;
a56a5e
     printf "%s\n" ${!a[@]}