]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-functions.sh: Avoid loading unnecessary 32-bit libraries for 64-bit initrds
authorColin Guthrie <colin@mageia.org>
Sat, 2 Nov 2013 11:26:30 +0000 (11:26 +0000)
committerHarald Hoyer <harald@redhat.com>
Thu, 7 Nov 2013 14:23:24 +0000 (15:23 +0100)
Due to the 'inst_libdir_file "libnss_files*"' in the udev-rules module
this caues the /usr/lib/libnss_files-2.18.so* to be included. This is a
32-bit library and pulls in a 32-bit version of glibc also even on a
64-bit system.

This is due to the fact that ldconfig -pN will print [/usr]/lib paths
from the cache as well as [/usr]/lib64. As we handle these paths
specifically we should ignore these results from the cache.

Also there was a missing space when appending the ldconfig paths
onto our list meaning the last builtin and first ldconfig path
were unusable.

dracut-functions.sh

index 38095ba42ab78e4323a4ac3bd840e43951b3b3fa..2872516aacf71ca32faee8152190d4d1c00efdc1 100755 (executable)
@@ -65,6 +65,7 @@ ldconfig_paths()
             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[@]}
@@ -81,7 +82,7 @@ if ! [[ $libdirs ]] ; then
         [[ -d /usr/lib ]] && libdirs+=" /usr/lib"
     fi
 
-    libdirs+="$(ldconfig_paths)"
+    libdirs+=" $(ldconfig_paths)"
 
     export libdirs
 fi