SVN: geninitrd/trunk/geninitrd

arekm arekm at pld-linux.org
Sun Oct 28 11:53:09 CET 2007


Author: arekm
Date: Sun Oct 28 11:53:08 2007
New Revision: 8880

Modified:
   geninitrd/trunk/geninitrd
Log:
Install resume from new location. Temporaily leave /usr/sbin/resume handling for backward compat.

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd	(original)
+++ geninitrd/trunk/geninitrd	Sun Oct 28 11:53:08 2007
@@ -1149,6 +1149,15 @@
 	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
+fi
+
 cache_modprobe_conf
 
 for n in $PREMODS; do
@@ -1256,15 +1265,19 @@
 #fi
 
 initrd_gen_suspend() {
-	if [ ! -x /usr/sbin/resume ]; then
-		die "/usr/sbin/resume is missing!"
+	if [ ! -x /usr/${_lib}/suspend/resume -a ! -x /usr/sbin/resume ]; then
+		die "/usr/${_lib}/suspend/resume is missing!"
 	fi
 	inst_d /etc /dev
 	resume_dev="$(awk '/^resume device =/ { print $4 } ' /etc/suspend.conf)"
 	inst /dev/snapshot /dev
 	inst $resume_dev /dev
 	inst /etc/suspend.conf /etc/suspend.conf
-	inst /usr/sbin/resume /bin/resume
+	if [ -x /usr/${_lib}/suspend/resume ]; then
+		inst /usr/${_lib}/suspend/resume /bin/resume
+	else
+		inst /usr/sbin/resume /bin/resume
+	fi
 	echo "resume" >> "$s"
 }
 


More information about the pld-cvs-commit mailing list