Package: hibernate
Version: 1.99-1
Severity: normal
Tags: patch

Hi,

Let me know if I'm missing something, but I couldn't find how to set the options
for s2both.

According to the s2ram manpage, "it is recommended to use s2both(8) s2ram is
only provided to  find  out  any  work around  needed to make suspend to both
work." The s2both manpage says, "The s2both command also inherits all command
line arguments from s2ram." So, it seems odd to me that the USuspendRam*
options don't apply when USuspendMethod is set to both.

Anyways, I made a patch that works for me. It turns out the s2both manpage is
inaccurate, as s2both doesn't accept the -a option, and uses -f for something
different. (I only use the USuspendRamForce and USuspendRamAcpiSleep options,
so those are the only ones I tested.) As a workaround, I made the scriptlet
pass the long version of these arguments. Something similar may be needed for
the others.

Anyways, with this patch, it makes sense to put "Include ususpend-ram.conf"
at the top of /etc/hibernate/ususpend-both.conf so that the user only needs to
figure out the right options once. (Since they will almost certainly need to
pass the same options to s2both as they needed for s2ram.)

Let me know if you want me to change anything.

Thanks,
Ivan


-- Package-specific info:
--- configuration
==> /etc/hibernate/common.conf <==
Verbosity 0
LogFile /var/log/hibernate.log
LogVerbosity 1
Distribution debian
SaveClock restore-only
LockXScreenSaver yes
UnloadBlacklistedModules yes
LoadModules auto
DownInterfaces wlan0
UpInterfaces auto
SwitchToTextMode yes
XStatus x
XosdSettings --font '-misc-fixed-medium-r-semicondensed--*-120-*-*-c-*-*-*' 
--colour=Green --shadow 1 --pos bottom --align center --offset 50
BackLight yes
==> /etc/hibernate/disk.conf <==
TryMethod ususpend-disk.conf
TryMethod sysfs-disk.conf
==> /etc/hibernate/hibernate.conf <==
TryMethod ususpend-both.conf
TryMethod suspend2.conf
TryMethod disk.conf
TryMethod ram.conf
==> /etc/hibernate/ram.conf <==
TryMethod ususpend-ram.conf
TryMethod sysfs-ram.conf
LockXScreenSaver yes
==> /etc/hibernate/suspend2.conf <==
UseSuspend2 yes
Reboot no
EnableEscape yes
DefaultConsoleLevel 1
Compressor lzf
Encryptor none
FullSpeedCPU yes
Include common.conf
==> /etc/hibernate/sysfs-disk.conf <==
UseSysfsPowerState disk
Include common.conf
==> /etc/hibernate/sysfs-ram.conf <==
UseSysfsPowerState mem
Include common.conf
==> /etc/hibernate/ususpend-both.conf <==
Include ususpend-ram.conf
USuspendMethod both
Include common.conf
==> /etc/hibernate/ususpend-disk.conf <==
USuspendMethod disk
Include common.conf
==> /etc/hibernate/ususpend-ram.conf <==
USuspendMethod ram
USuspendRamForce yes
USuspendRamAcpiSleep 3
Include common.conf

--- /sys/power
==> /sys/power/disk <==
[platform] test testproc shutdown reboot 
==> /sys/power/image_size <==
952130109
==> /sys/power/resume <==
254:0
==> /sys/power/state <==
mem disk

--- s2ram -n
Machine unknown
This machine can be identified by:
    sys_vendor   = ""
    sys_product  = ""
    sys_version  = ""
    bios_version = ""
--- log
Starting suspend at Fri Nov 7 11:58:37 EST 2008
hibernate: [01] Executing CheckLastResume ... 
hibernate: [01] Executing CheckRunlevel ... 
hibernate: [01] Executing LockFileGet ... 
hibernate: [01] Executing NewKernelFileCheck ... 
hibernate: [05] Executing XStatusSuspendBegin ... 
hibernate: [10] Executing EnsureUSuspendCapable ... 
hibernate: [11] Executing XHacksSuspendHook1 ... 
hibernate: [20] Executing XStatusProgress ... 
hibernate: [30] Executing XStatusProgress ... 
hibernate: [40] Executing XStatusProgress ... 
hibernate: [50] Executing XStatusProgress ... 
hibernate: [59] Executing RemountXFSBootRO ... 
hibernate: [60] Executing NetworkStop ... 
hibernate: [60] Executing XStatusProgress ... 
hibernate: [70] Executing XStatusProgress ... 
hibernate: [80] Executing XStatusProgress ... 
hibernate: [89] Executing SaveKernelModprobe ... 
hibernate: [90] Executing XStatusProgress ... 
hibernate: [91] Executing LockXScreensaver ... 
xscreensaver-command: activating and locking.

hibernate: [91] Executing ModulesUnloadBlacklist ... 
hibernate: [91] Executing ModulesUnloadBlacklist ... 
hibernate: [95] Executing XHacksSuspendHook2 ... 
hibernate: [95] Executing XStatusProgress ... 
hibernate: [98] Executing CheckRunlevel ... 
hibernate: [98] Executing DimBackLight ... 
hibernate: [98] Executing XStatusProgressKill ... 
hibernate: [99] Executing DoUSuspend ... 
hibernate: Running /usr/sbin/s2both  --force --acpi_sleep 3...
hibernate: [95] Executing XStatusResumeBegin ... 
hibernate: [90] Executing XStatusProgress ... 
hibernate: [90] Executing RestoreBackLight ... 
hibernate: [90] Executing ModulesLoad ... 
hibernate: [89] Executing RestoreKernelModprobe ... 
hibernate: [85] Executing XHacksResumeHook2 ... 
hibernate: [80] Executing XStatusProgress ... 
hibernate: [70] Executing XStatusProgress ... 
hibernate: [70] Executing ClockRestore ... 
hibernate: [70] Executing ClockRestore ... 
hibernate: [60] Executing XStatusProgress ... 
hibernate: [60] Executing NetworkStart ... 
hibernate: [59] Executing RemountXFSBootRW ... 
hibernate: [50] Executing XStatusProgress ... 
hibernate: [40] Executing XStatusProgress ... 
hibernate: [30] Executing XStatusProgress ... 
hibernate: [30] Executing UnlockXScreensaver ... 
hibernate: [20] Executing XStatusProgress ... 
hibernate: [15] Executing XStatusProgress ... 
hibernate: [11] Executing XHacksResumeHook1 ... 
hibernate: [05] Executing XStatusProgressKill ... 
hibernate: [01] Executing XStatusReportErrors ... 
hibernate: [01] Executing NoteLastResume ... 
hibernate: [01] Executing LockFilePut ... 
Resumed at Sun Nov 9 22:54:14 EST 2008

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages hibernate depends on:
ii  console-tools            1:0.2.3dbs-65.1 Linux console and font utilities

Versions of packages hibernate recommends:
pn  dash                          <none>     (no description available)
ii  hdparm                        8.9-2      tune hard disk parameters for high
ii  uswsusp                       0.8-1.1    tools to use userspace software su
ii  vbetool                       1.0-3      run real-mode video BIOS code to a

Versions of packages hibernate suggests:
pn  915resolution                 <none>     (no description available)
ii  xscreensaver                  5.05-3     Automatic screensaver for X

-- no debconf information
--- /root/ususpend.orig 2008-10-28 01:30:27.432726201 -0400
+++ /usr/share/hibernate/scriptlets.d/ususpend  2008-10-28 01:44:52.569246666 
-0400
@@ -33,10 +33,7 @@
     case "$1" in
        ususpendmethod)
            case "$2" in
-               disk|both) USUSPEND_PROG=s2$2;;
-               ram)
-                   USUSPEND_PROG=s2ram
-                   ;;
+               disk|both|ram) USUSPEND_PROG=s2$2;;
                *)
                    vecho 1 "$EXE: Invalid value fo USuspendMethod."
                    return 2
@@ -104,13 +101,13 @@
 DoUSuspend() {
     if [ -z "$USUSPEND_NO_SUSPEND" ] ; then
        ARGS=
-       if [ "$USUSPEND_PROG" = s2ram ]; then
-           [ $USUSPEND_RAM_FORCE -eq 1 ] && ARGS="$ARGS -f"
+       if [ "$USUSPEND_PROG" = s2ram  -o "$USUSPEND_PROG" = s2both ]; then
+           [ $USUSPEND_RAM_FORCE -eq 1 ] && ARGS="$ARGS --force"
            [ $USUSPEND_RAM_VBESAVE -eq 1 ] && ARGS="$ARGS -s"
            [ $USUSPEND_RAM_VBEPOST -eq 1 ] && ARGS="$ARGS -p"
            [ $USUSPEND_RAM_RADEONTOOL -eq 1 ] && ARGS="$ARGS -r"
            [ $USUSPEND_RAM_VBEMODE -eq 1 ] && ARGS="$ARGS -m"
-           [ $USUSPEND_RAM_ACPISLEEP -ne 0 ] && ARGS="$ARGS -a 
$USUSPEND_RAM_ACPISLEEP"
+           [ $USUSPEND_RAM_ACPISLEEP -ne 0 ] && ARGS="$ARGS --acpi_sleep 
$USUSPEND_RAM_ACPISLEEP"
            [ $USUSPEND_RAM_PCISAVE -eq 1 ] && ARGS="$ARGS -v"
        fi
        vecho 1 "$EXE: Running $USUSPEND_PROG_PATH $ARGS..."

Reply via email to