Blame 0027-dracut-functions.sh-Avoid-loading-unnecessary-32-bit.patch

Harald Hoyer 4734ec
From 1d50dfe6025126c38b1d23815360bd48e9e8c24c Mon Sep 17 00:00:00 2001
Harald Hoyer 4734ec
From: Colin Guthrie <colin@mageia.org>
Harald Hoyer 4734ec
Date: Sat, 2 Nov 2013 11:26:30 +0000
Harald Hoyer 4734ec
Subject: [PATCH] dracut-functions.sh: Avoid loading unnecessary 32-bit
Harald Hoyer 4734ec
 libraries for 64-bit initrds
Harald Hoyer 4734ec
Harald Hoyer 4734ec
Due to the 'inst_libdir_file "libnss_files*"' in the udev-rules module
Harald Hoyer 4734ec
this caues the /usr/lib/libnss_files-2.18.so* to be included. This is a
Harald Hoyer 4734ec
32-bit library and pulls in a 32-bit version of glibc also even on a
Harald Hoyer 4734ec
64-bit system.
Harald Hoyer 4734ec
Harald Hoyer 4734ec
This is due to the fact that ldconfig -pN will print [/usr]/lib paths
Harald Hoyer 4734ec
from the cache as well as [/usr]/lib64. As we handle these paths
Harald Hoyer 4734ec
specifically we should ignore these results from the cache.
Harald Hoyer 4734ec
Harald Hoyer 4734ec
Also there was a missing space when appending the ldconfig paths
Harald Hoyer 4734ec
onto our list meaning the last builtin and first ldconfig path
Harald Hoyer 4734ec
were unusable.
Harald Hoyer 4734ec
---
Harald Hoyer 4734ec
 dracut-functions.sh | 3 ++-
Harald Hoyer 4734ec
 1 file changed, 2 insertions(+), 1 deletion(-)
Harald Hoyer 4734ec
Harald Hoyer 4734ec
diff --git a/dracut-functions.sh b/dracut-functions.sh
Harald Hoyer 4734ec
index 38095ba..2872516 100755
Harald Hoyer 4734ec
--- a/dracut-functions.sh
Harald Hoyer 4734ec
+++ b/dracut-functions.sh
Harald Hoyer 4734ec
@@ -65,6 +65,7 @@ ldconfig_paths()
Harald Hoyer 4734ec
             printf "%s\n" ${d%/*};
Harald Hoyer 4734ec
         done
Harald Hoyer 4734ec
     ); do
Harald Hoyer 4734ec
+        [[ "$i" = "/lib" || "$i" = "/usr/lib" || "$i" = "/lib64" || "$i" = "/usr/lib64" ]] && continue
Harald Hoyer 4734ec
         a["$i"]=1;
Harald Hoyer 4734ec
     done;
Harald Hoyer 4734ec
     printf "%s\n" ${!a[@]}
Harald Hoyer 4734ec
@@ -81,7 +82,7 @@ if ! [[ $libdirs ]] ; then
Harald Hoyer 4734ec
         [[ -d /usr/lib ]] && libdirs+=" /usr/lib"
Harald Hoyer 4734ec
     fi
Harald Hoyer 4734ec
 
Harald Hoyer 4734ec
-    libdirs+="$(ldconfig_paths)"
Harald Hoyer 4734ec
+    libdirs+=" $(ldconfig_paths)"
Harald Hoyer 4734ec
 
Harald Hoyer 4734ec
     export libdirs
Harald Hoyer 4734ec
 fi