[readonly/geninitrd: 478/1068] Install resume from new location. Temporaily leave /usr/sbin/resume handling for backward compat.

draenog draenog at pld-linux.org
Sat Nov 2 19:52:34 CET 2013


commit 551c3b3e21aac2ee6ed203842036b9fb27a233f2
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sun Oct 28 10:53:08 2007 +0000

    Install resume from new location. Temporaily leave /usr/sbin/resume handling for backward compat.
    
    svn-id: @8880

 geninitrd | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index b3a866f..328fdc1 100755
--- a/geninitrd
+++ b/geninitrd
@@ -1149,6 +1149,15 @@ 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
+fi
+
 cache_modprobe_conf
 
 for n in $PREMODS; do
@@ -1256,15 +1265,19 @@ modules_add_linuxrc "$MODULES" "$s"
 #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"
 }
 
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list