[readonly/geninitrd: 488/1068] - rpm -E is unreliable as it requires rpm-build macros present - use $_lib when installing with inst

draenog draenog at pld-linux.org
Sat Nov 2 19:53:25 CET 2013


commit 7efbe84163e2d5de70aa2e764276c497926c072b
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Tue Oct 30 20:51:43 2007 +0000

    - rpm -E is unreliable as it requires rpm-build macros present
    - use $_lib when installing with inst_exec()
    
    svn-id: @8906

 geninitrd | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index ba85ce2..3353998 100755
--- a/geninitrd
+++ b/geninitrd
@@ -334,9 +334,9 @@ inst_exec() {
 
 	local lib libs=$(ldd "$@" | awk '/statically|linux-gate\.so/{next} NF == 2 {print $1} /=/{print $3}' | sort -u)
 	for lib in $libs; do
-		if [ ! -f "$MNTIMAGE/lib/${lib##*/}" ]; then
-			inst_d /lib
-			inst_exec $lib /lib
+		if [ ! -f "$MNTIMAGE/$_lib/${lib##*/}" ]; then
+			inst_d /$_lib
+			inst_exec $lib /$_lib
 		fi
 	done
 }
@@ -1154,14 +1154,12 @@ if [ ! -f /proc/mounts ]; then
 	echo >&2 "WARNING: /proc filesystem not mounted, may cause wrong results or failure."
 fi
 
-_lib=$(rpm -E "%{_lib}" 2> /dev/null)
-if [ -z "${_lib}" ]; then
-	if [ -d /usr/lib64 ]; then
-		_lib=lib64
-	else
-		_lib=lib
-	fi
+if [ -d /usr/lib64 ]; then
+	_lib=lib64
+else
+	_lib=lib
 fi
+debug "_lib: $_lib"
 
 cache_modprobe_conf
 
@@ -1384,7 +1382,6 @@ initrd_gen_udev() {
 
 initrd_gen_multipath() {
 	inst_d /proc /sys /sbin /lib/udev /etc
-	ln -s lib $MNTIMAGE/lib64
 	inst_exec /sbin/kpartx /sbin
 	inst_exec /sbin/multipath /sbin
 	# for udev callouts
@@ -1406,13 +1403,13 @@ initrd_gen_multipath() {
 
 	echo "export multipath_id=$MULTIPATH_ID" | add_linuxrc
 	add_linuxrc <<-'EOF'
+		debugshell
 		/sbin/multipath -v 0 $multipath_id
 
 		for a in /dev/mapper/*; do
 			[ $a = /dev/mapper/control ] && continue
 			/sbin/kpartx -a $a
 		done
-
 		debugshell
 
 		umount /sys
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/147754ca159d40ca5eb541074dc043d8cbd92090



More information about the pld-cvs-commit mailing list