[readonly/geninitrd/devel: 227/334] Software suspend 2 support added (untested).

draenog draenog at pld-linux.org
Sat Nov 2 19:30:37 CET 2013


commit 2c52f208e5ab86a7bc2e6ce3a771e100cbcc7fc1
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sat Jul 31 01:26:22 2004 +0000

    Software suspend 2 support added (untested).
    
    svn-id: @4411

 geninitrd | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)
---
diff --git a/geninitrd b/geninitrd
index 7b4018a..5341938 100755
--- a/geninitrd
+++ b/geninitrd
@@ -20,6 +20,7 @@ COMPRESS="yes"
 USERAIDSTART="yes"
 USEMDADMSTATIC="no"
 USEINSMODSTATIC="no"
+USESUSPEND="no"
 uselvm="no"
 usenfs="no"
 # it should be safe to remove scsi_mod from here, but I'm not sure...
@@ -703,6 +704,9 @@ while [ $# -gt 0 ]; do
 	--without-bootsplash)
 		BOOT_SPLASH="no"
 		;;
+	--without-suspend)
+		USESUSPEND="no";
+		;;
 	--lvmtoolsversion=|--lvmversion=)
 		LVMTOOLSVERSION="`echo $1 | awk -F= '{print $2;}'`"
 		;;
@@ -892,7 +896,12 @@ for n in $BASICMODULES; do
 	findmodule "$n"
 done
 
-
+if is_yes "$USESUSPEND"; then
+    for n in suspend2_core suspend2_lzf suepend2_block_io suspend2_swap; do
+	findmodule "$n"
+    done
+fi
+			
 if [ -n "$ifneeded" -a -z "$MODULES" ]; then
 	if [ -n "$verbose" ]; then
 		echo "No modules are needed -- not building initrd image."
@@ -1001,6 +1010,20 @@ done
 #	echo "losetup $rootdev1 /loopfs$loopFile" >> "$RCFILE"
 #fi
 
+if is_yes "$USESUSPEND"; then
+    	mkdir -p $MNTIMAGE/sys
+    	mkdir -p $MNTIMAGE/proc
+	echo "mount -t proc none /proc" >> "$s"
+	echo "cmdline=\`cat /proc/cmdline\`" >> "$s"
+	echo "if [ \"$cmdline\" != \"${cmdline#* resume2=}\" ]; then" >> "$s"
+	echo "	mount -t proc none /proc" >> "$s"
+	echo "	umount /proc" >> "$s"
+	echo "	echo > /proc/software_suspend/activate" >> "$s"
+	echo "	exit 0" >> "$s"
+	echo "fi" >> "$s"
+	echo "umount /proc" >> "$s"
+fi
+
 if is_yes "$USERAIDSTART" && is_yes "$raidfound" ; then
 	[ -n "$verbose" ] && echo "Setting up mdadm..."
 	
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/398807324938659207036e520c0950a61ef50c11



More information about the pld-cvs-commit mailing list