Hello,

while merging the recently updated Debian diff with my loop-AES
patched version, I stumbled upon an unrelated patch to extend
suspend2 support in yaird, which stems from a migration from
uswsusp to suspend2.

Below, I have included a patch which adds support for the new sysfs
interface of suspend2 (>= 2.2.7), similar to the patch by Tino Keitel.

In addition, the RESUME template passes the optional swap partition
parameter with the RESUME directive in Default.cfg to the suspend2
kernel interface, in case no "resume2=..." parameter has been given
on the kernel command line.

Regards,
Peter
--- Templates.cfg	2007-03-31 15:54:24.000000000 +0200
+++ Templates.cfg	2007-02-05 17:16:43.000000000 +0100
@@ -588,12 +530,25 @@
 			!then
 			!  # for suspend2 (>= 2.2-rc8)
 			!  if [ -w /proc/suspend2/do_resume ]; then
+			!    if [ -z "$resume2" ]; then
+			!      echo "swap:<TMPL_VAR NAME=target>" > /proc/suspend2/resume2
+			!    fi
 			!    echo > /proc/suspend2/do_resume
 			!  fi
 			!  # for suspend2 (< 2.2-rc8)
 			!  if [ -w /proc/software_suspend/do_resume ]; then
+			!    if [ -z "$resume2" ]; then
+			!      echo "swap:<TMPL_VAR NAME=target>" > /proc/software_suspend/resume2
+			!    fi
 			!    echo > /proc/software_suspend/do_resume
 			!  fi
+			!  # for suspend2 (>= 2.2.7)
+			!  if [ -w /sys/power/suspend2/do_resume ]; then
+			!    if [ -z "$resume2" ]; then
+			!      echo "swap:<TMPL_VAR NAME=target>" > /sys/power/suspend2/resume2
+			!    fi
+			!    echo > /sys/power/suspend2/do_resume
+			!  fi
 			!  # for swsusp
 			!  if [ -n "$resume" ]
 			!  then

Reply via email to