Differences between revisions 4 and 6 (spanning 2 versions)
Revision 4 as of 2009-01-25 09:45:42
Size: 4404
Editor: ?SamuliSeppänen
Comment:
Revision 6 as of 2009-01-25 09:48:32
Size: 4332
Editor: ?SamuliSeppänen
Comment:
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:
If you need to run custom commands when suspending/resuming, you should write custom scripts to is in /etc/pm/sleep.d. Modifying the /etc/hibernate/*.conf files seems to have NO effect at all. You can use the script below as an example. Alternatively you can grab an existing script from /usr/lib/pm-utils/sleep.d/ and modify it. If you need to run custom commands when suspending/resuming, you should place your custom scripts to /etc/pm/sleep.d. Modifying the /etc/hibernate/*.conf files seems to have NO effect at all. You can use the script below as an example. Alternatively you can grab an existing script from /usr/lib/pm-utils/sleep.d/ and modify it.
Line 43: Line 43:
Debian Lenny seems to default to uswsusp, but if your kernel supports Tuxonice (a.k.a. Suspend2), it should use that instead - at least if you configured Tuxonice to override swsusp when configuring the kernel. Debian Lenny seems to default to uswsusp, but if your kernel supports Tuxonice (a.k.a. Suspend2), it should automatically use that instead.

This page presents hibernation under Debian.

Suspend and hibernate configuration in Debian Lenny

The hibernation/suspend subsystem in Debian Lenny is rather unintuitive. It seems that the hibernate scripts in /etc/hibernate are used in conjunction with [http://pm-utils.freedesktop.org/wiki PM-utils]. There's a pretty good description how hibernation works in Ubuntu in here:

* https://bugs.launchpad.net/ubuntu/+source/pm-utils/+bug/191185

Most of that seems is valid with Debian Lenny. The acpi-support stuff is Ubuntu-specific, though.

If you need to run custom commands when suspending/resuming, you should place your custom scripts to /etc/pm/sleep.d. Modifying the /etc/hibernate/*.conf files seems to have NO effect at all. You can use the script below as an example. Alternatively you can grab an existing script from /usr/lib/pm-utils/sleep.d/ and modify it.

# /etc/pm/sleep.d/51wireless
#
# The /etc/pm/sleep.d is the right place to put your custom suspend/resume scripts.
# None of the stuff in /etc/hibernate/ has _any_ effect (OnResume, RestartServices,
# UnloadModules etc). The /etc/init.d/atheros script is just a simple wrapper for
# unloading the ath_pci module.

case "$1" in
        hibernate|suspend)
                /etc/init.d/bluetooth stop
                /etc/init.d/atheros stop

                ;;
        thaw|resume)
                /etc/init.d/bluetooth start
                /etc/init.d/atheros start
                ;;
        *) exit $NA
                ;;
esac

Debian Lenny seems to default to uswsusp, but if your kernel supports Tuxonice (a.k.a. Suspend2), it should automatically use that instead.

Uswsusp

uswsusp is the default hibernation tool in ["DebianEtch"]. It uses an existing swap partition to saved the memory state (see /etc/uswsusp.conf).

hibernate

ToDo : write this paragraph.

Debugging hibernation

Kernel testing facility

Since linux 2.6.25, the kernel has a new Hibernation testing facility [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4cc79776c9ea431790e04fcacbebb30d28eb1570 changelog].

Make it possible to test the hibernation core code with the help of the /sys/power/pm_test attribute introduced for suspend testing in the previous patch.

Writing an appropriate string to this file causes the hibernation code to work in one of the test modes defined as follows:

freezer
test the freezing of processes
devices
test the freezing of processes and suspending of devices
platform
test the freezing of processes, suspending of devices and platform global control methods(*)
processors
test the freezing of processes, suspending of devices, platform global control methods(*) and the disabling of nonboot CPUs
core
test the freezing of processes, suspending of devices, platform global control methods(*), the disabling of nonboot CPUs and suspending of platform/system devices

*) The platform global control methods are only available on ACPI systems and are only tested if the hibernation mode is set to "platform"

Then, if a hibernation is started by normal means, the hibernation core will perform its normal operations up to the point indicated by given test level. Next, it will wait for 5 seconds and carry out the resume operations needed to transition the system back to the fully functional state.

The actual message (for googlers) are hibernation debug: Waiting for 5 seconds and swsusp debug: Waiting for 5 seconds.