~ubuntu-branches/debian/stretch/uswsusp/stretch

« back to all changes in this revision

Viewing changes to scripts/suse-10.1/do_acpi_sleep.patch

  • Committer: Bazaar Package Importer
  • Author(s): Christian Perrier
  • Date: 2008-08-20 09:09:13 UTC
  • mfrom: (0.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080820090913-0eahue1zo8egcxls
Tags: 0.8-1.1
* Non-maintainer upload to fix pending l10n issues.
* Remove extra and useless debian/po/ff/ directory
* Debconf translation updates:
  - Japanese. Closes: #489939
  - German. Closes: #493747
  - French. Closes: #493771
  - Romanian. Closes: #493772
  - Galician. Closes: #494050
  - Finnish. Closes: #494087
  - Italian. Closes: #494096
  - Basque. Closes: #494277
  - Basque. Closes: #494277
  - Czech. Closes: #494410
  - Swedish. Closes: #494412
  - Russian. Closes: #495412
  - Portuguese. Closes: #495451
  - Spanish. Closes: #495499
  - Slovak. Closes: #495516

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
9
 
 
10
 # blank the "suspend console"
 
11
 deallocvt 63
 
12
@@ -68,20 +70,25 @@ fi
 
13
 
 
14
 case "$1" in
 
15
     suspend2disk)
 
16
-       IMG_SZ=0
 
17
-       read IMG_SZ < /sys/power/image_size     
 
18
-       $MYECHO /sys/power/state disk
 
19
-       RET=$?      # 28=ENOSPC, "not enough swap."
 
20
-       #
 
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
 
29
                RET=$?
 
30
-               echo $IMG_SZ > /sys/power/image_size
 
31
-        fi
 
32
+       else
 
33
+               IMG_SZ=0
 
34
+               read IMG_SZ < /sys/power/image_size     
 
35
+               $MYECHO /sys/power/state disk
 
36
+               RET=$?      # 28=ENOSPC, "not enough swap."
 
37
+               #
 
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
 
44
+                       RET=$?
 
45
+                       echo $IMG_SZ > /sys/power/image_size
 
46
+               fi
 
47
+       fi
 
48
        [ "$SUSPEND2DISK_RESTORE_CLOCK" == "yes" ] && $HWCLOCK $OPT
 
49
        ;;
 
50
     suspend2ram)