SVN: geninitrd/trunk: Makefile geninitrd mod-tuxonice.sh

glen glen at pld-linux.org
Fri Apr 3 00:30:45 CEST 2009


Author: glen
Date: Fri Apr  3 00:30:45 2009
New Revision: 10283

Added:
   geninitrd/trunk/mod-tuxonice.sh
Modified:
   geninitrd/trunk/Makefile
   geninitrd/trunk/geninitrd
Log:
- tuxonice modularized

Modified: geninitrd/trunk/Makefile
==============================================================================
--- geninitrd/trunk/Makefile	(original)
+++ geninitrd/trunk/Makefile	Fri Apr  3 00:30:45 2009
@@ -1,6 +1,6 @@
 # when making release, make sure you do it as RELEASE document describes
 VERSION		:= 10000.3
-MODS		:= mod-ide.sh mod-luks.sh mod-multipath.sh mod-dmraid.sh mod-lvm.sh mod-md.sh mod-blkid.sh mod-udev.sh
+MODS		:= mod-ide.sh mod-luks.sh mod-multipath.sh mod-dmraid.sh mod-lvm.sh mod-md.sh mod-blkid.sh mod-udev.sh mod-tuxonice.sh
 FILES		:= Makefile geninitrd.sysconfig geninitrd functions $(MODS) geninitrd.8 geninitrd.8.xml ChangeLog
 prefix		:= /usr
 mandir		:= $(prefix)/share/man

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd	(original)
+++ geninitrd/trunk/geninitrd	Fri Apr  3 00:30:45 2009
@@ -19,7 +19,6 @@
 GENINITRD_MODS=""
 COMPRESS=yes
 USE_SUSPEND=yes
-USE_TUXONICE=no
 # it should be safe to remove scsi_mod from here, but I'm not sure...
 PRESCSIMODS="-scsi_mod unknown -sd_mod"
 target=""
@@ -745,23 +744,6 @@
 	EOF
 }
 
-initrd_gen_tuxonice() {
-	mount_sys
-	add_linuxrc <<-'EOF'
-		resume=no
-		for arg in $CMDLINE; do
-			if [ "${arg##resume=}" != "${arg}" -o "${arg##resume2=}" != "${arg}" ]; then
-				resume=yes
-			fi
-		done
-		if [ "$resume" = "yes" ]; then
-			[ -e /proc/suspend2/do_resume ] && echo > /proc/suspend2/do_resume
-			[ -e /sys/power/suspend2/do_resume ] && echo > /sys/power/suspend2/do_resume
-			[ -e /sys/power/tuxonice/do_resume ] && echo > /sys/power/tuxonice/do_resume
-		fi
-	EOF
-}
-
 initrd_gen_v86d() {
 	debug "initrd_gen_v86d"
 	mknod $DESTDIR/dev/mem c 1 1
@@ -1055,12 +1037,6 @@
 
 geninitrd_load_mods ide luks multipath dmraid lvm md blkid udev
 
-# backwards compatible
-if [ "$USE_SUSPEND2" ]; then
-	USE_TUXONICE=$USE_SUSPEND2
-	warn "USE_SUSPEND2 is deprecated, use USE_TUXONICE now instead."
-fi
-
 while [ $# -gt 0 ]; do
 	case $1 in
 	--fstab=*)

Added: geninitrd/trunk/mod-tuxonice.sh
==============================================================================
--- (empty file)
+++ geninitrd/trunk/mod-tuxonice.sh	Fri Apr  3 00:30:45 2009
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# geninitrd mod: tuxonice
+
+USE_TUXONICE=no
+
+#
+# setup geninitrd module
+# @access	public
+setup_mod_tuxonice() {
+	# backwards compatible
+
+	if [ "$USE_SUSPEND2" ]; then
+		USE_TUXONICE=$USE_SUSPEND2
+		warn "USE_SUSPEND2 is deprecated, use USE_TUXONICE now instead."
+	fi
+}
+
+# generate initrd fragment
+# @access	public
+initrd_gen_tuxonice() {
+	mount_sys
+	add_linuxrc <<-'EOF'
+		resume=no
+		for arg in $CMDLINE; do
+			if [ "${arg##resume=}" != "${arg}" -o "${arg##resume2=}" != "${arg}" ]; then
+				resume=yes
+			fi
+		done
+		if [ "$resume" = "yes" ]; then
+			[ -e /proc/suspend2/do_resume ] && echo > /proc/suspend2/do_resume
+			[ -e /sys/power/suspend2/do_resume ] && echo > /sys/power/suspend2/do_resume
+			[ -e /sys/power/tuxonice/do_resume ] && echo > /sys/power/tuxonice/do_resume
+		fi
+	EOF
+}
+


More information about the pld-cvs-commit mailing list