SVN: geninitrd/trunk/geninitrd

wiget wiget at pld-linux.org
Sat Dec 3 20:52:27 CET 2011


Author: wiget
Date: Sat Dec  3 20:52:27 2011
New Revision: 12426

Modified:
   geninitrd/trunk/geninitrd
Log:
Don't run ldd on dynamic linker

$ ldd /lib64/ld-linux-x86-64.so.2
loader cannot load itself
ldd: exited with unknown exit code (127)

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd	(original)
+++ geninitrd/trunk/geninitrd	Sat Dec  3 20:52:27 2011
@@ -432,7 +432,12 @@
 
 	inst "$@" $dest
 
-	local lib libs=$(ldd "$@" | awk '/statically|linux-(gate|vdso)\.so/{next} NF == 2 {print $1} /=/{print $3}' | sort -u)
+	local obj lib libs
+	for obj in "$@"; do
+		if [ "$obj" != "/lib/ld-linux.so.2" ] && [ "$obj" != "/lib64/ld-linux-x86-64.so.2" ]; then
+			libs=$(ldd "$obj" | awk '/statically|linux-(gate|vdso)\.so/{next} NF == 2 {print $1} /=/{print $3}' | sort -u)
+		fi
+	done
 	for lib in $libs; do
 		if [ ! -f "$DESTDIR/$_lib/${lib##*/}" ]; then
 			inst_d /$_lib


More information about the pld-cvs-commit mailing list