1
--- a/do_acpi_sleep 2006-07-20 03:45:02.000000000 +0200
2
+++ b/do_acpi_sleep 2006-07-25 18:27:42.000000000 +0200
3
@@ -54,6 +54,8 @@ OPT="--hctosys"
4
# where is the s2ram binary installed?
5
S2RAM="/usr/sbin/s2ram"
6
S2RAM_LOG=/var/log/suspend2ram.log
7
+S2DISK="/usr/local/sbin/s2disk"
8
+S2DISK_LOG=/var/log/suspend2disk.log
10
# blank the "suspend console"
12
@@ -68,20 +70,25 @@ fi
17
- read IMG_SZ < /sys/power/image_size
18
- $MYECHO /sys/power/state disk
19
- RET=$? # 28=ENOSPC, "not enough swap."
21
- # the logic here is:
22
- # if image_size > 0 (without kernel support, IMG_SZ will be zero),
23
- # and we got ENOSPC, then try again with image_size set to zero.
24
- if [ $RET -eq 28 -a $IMG_SZ -ne 0 ]; then # try again with minimal image size
25
- echo 0 > /sys/power/image_size
26
- $MYECHO /sys/power/state disk
27
+ if [ -x $S2DISK ]; then
28
+ $S2DISK >> $S2DISK_LOG 2>&1
30
- echo $IMG_SZ > /sys/power/image_size
34
+ read IMG_SZ < /sys/power/image_size
35
+ $MYECHO /sys/power/state disk
36
+ RET=$? # 28=ENOSPC, "not enough swap."
38
+ # the logic here is:
39
+ # if image_size > 0 (without kernel support, IMG_SZ will be zero),
40
+ # and we got ENOSPC, then try again with image_size set to zero.
41
+ if [ $RET -eq 28 -a $IMG_SZ -ne 0 ]; then # try again with minimal image size
42
+ echo 0 > /sys/power/image_size
43
+ $MYECHO /sys/power/state disk
45
+ echo $IMG_SZ > /sys/power/image_size
48
[ "$SUSPEND2DISK_RESTORE_CLOCK" == "yes" ] && $HWCLOCK $OPT