Software Suspend 2 in debian

What's included?

Linux stock kernel 2.6.9 with swsusp2.1 patches, as well as ndiswrapper modules. The binaries are built solely for x86 and optimized for the 686 target. The kernel should work with a sarge (Debian 3.1) or unstable installation.

Installing the swsusp2-enabled debian kernels

Add the following lines to your /etc/apt/sources.list:

deb http://karmafish.net/~loevborg/debian binary/
deb http://cp.yi.org/apt/hibernate ./

Then invoke apt-get update and apt-get install kernel-image-2.6.9.sws102204. Your boot loader configuration must use the included initrd image. Be sure to add append="resume2=/dev/hdXX" where hdXX is the device of you swap partition to your lilo.conf. Don't forget to run lilo after making the necessary changes. If you need ndiswrapper modules for the kernel as well, they can be conveniently installed using {{apt-get install ndiswrapper-modules}}.

To install the hibernate script that controls the suspending issue apt-get install hibernate.

Using swsusp2

You can check whether swsusp2 is included in your kernel by verifying if the directory /proc/software_suspend exists. When there are problems, use

dmesg | grep -i suspend

to see if there were errors during bootup. To get software suspend to work properly, you will likely have to tweak your /etc/hibernate/hibernate.conf. Especially LeaveXBeforeSuspend yes is often necessary in order to be able to suspend when running X11. After having a look at that file, you can try to hibernate:

/usr/sbin/hibernate

If all works well, you can install the acpid package (if you haven't already done so) and edit you /etc/acpi/powerbtn.sh to read:

#!/bin/sh
# /etc/acpi/poweroff.sh
# Initiates a shutdown when the power putton has been
# pressed.

if [ -d /proc/software_suspend ]; then
hibernate
else
poweroff
fi
When you push the power off button of you computer, it will now "go to sleep" instead of shutting down if swsusp2 is properly loaded.

Troubleshooting

If there are difficulties during the suspend/resume cycle, there are a number of places to look at:

Steps taken to a swsusp2-enabled kernel package for debian (incomplete)

Appendix

Send questions, comments, and criticism to pesterhazy@gmx.net. For the original swsusp2 project visit http://softwaresuspend.berlios.de/, for debian-packaging-specific information http://swsusp.sourceforge.net/wiki/DebianInitrd and http://softwaresuspend.berlios.de/FAQ-6.html