Suspend To Disk Using uswsusp and genkernel

aka uswsusp is the mainline suspend/resume solution. It contain both s2ram (suspend to RAM) and s2disk (suspend to disk aka hibernate). The problem is that Genkernel developers ignores the need to use suspend properly see.

Preparations
Assuming swap partition is at /dev/sda2:

Modify: {{File|/usr/share/genkernel/defaults/linuxrc.uswsusp| . /etc/initrd.defaults . /etc/initrd.scripts +swsusp_resume { +   /sbin/resume +} splash { }}
 * 1) !/bin/sh

Basically it will use standard genkernel process with the patched linuxrc script and inject the resume utility and suspend.conf into the initramfs.

Test

 * Switch to text mode.
 * Run:


 * Wait for computer to turn off.
 * Turn on computer.
 * After boot you should resume right after the s2disk.

Integrating splashutils
uswsusp can show nice splash activity during suspend/resume.

Add:

Recreate the initramfs overlay with the new resume and suspend.conf.

Run genkernel again now as splash enabled, and again.

hibernate-script
Suspending from graphical environment or within complex environment requires tweaking. There are two alternatives: sys-power/hibernate-script and sys-power/pm-utils.

I use the hibernate-script as it is simple and extensible framework.

Modify:

Now you can suspend from anywhere, try:

acpid
The following will suspend to disk when sleep button is pressed, and suspend to RAM if power button is pressed or lid is closed, add:

Suspend to RAM
Suspend to RAM is more problematic than suspend to disk as it requires hardware support and cooperation. In most recent laptops it works correctly.

Use the hibernate script, you may need to alter:

If still not being able to wake up, try to play with other tweaks available in file.

Maintainer
Alon Bar-Lev