ACPI fairies

I went back to the Ubuntu Down Under conference yesterday and had quite a nice day. The specification writing was winding down, and therefore it was possible to communally laptop. Sitting around with a bunch of people all using laptops is more communal than it sounds, especially in a sunny room with comfy couches and beanbags.

This also meant that Andrew and I got a visit from an ACPI fairy in its human incarnation Matthew Garrett to make our laptop suspension and hibernation work in Ubuntu.

In order to save Canonical the expense of a personal visit from the the angry (not-)DPL to every Ubuntu user in the world, here are some notes, some of which I knew about:

Enabling sleep and hibernate

The file /etc/default/acpi-support needs to contain some lines that look like these two:

ACPI_SLEEP=true
ACPI_HIBERNATE=true

Setting up hibernate to resume from your swap partition

People who installed Ubuntu in some early-ish phase of its lifecycle need to edit their /etc/mkinitrd/mkinitrd.conf file. Down the bottom there will be a commented-out line like this:

#RESUME=

Uncomment this and point it at your swap parition (replacing /dev/hda3 with your own swap partition):

RESUME=/dev/hda3

Then run the following set of commands as root (replacing /dev/hda3 with your own swap partition, and 2.6.10-5-686 with your kernel version as necessary):

mkswap /dev/hda3
swapon -a
mkinitrd -o /boot/initrd.img-2.6.10-5-686

Re-fairying acpid

If you tested out ACPI support earlier in Matthew Garrett’s Hoary testing cycle, you may have installed acpid from his laptop apt repository. Unfortunately, that version is numbered 1.0.4-1ubuntu1+mjg59-1 and the version that shipped with Hoary, 1.0.4-1ubuntu4, while more featureful, looks like a downgrade to apt and associated tools. You should install the Hoary version of the package by whatever means you have available. This made suspend to RAM work for me.

Believing in fairies

I think someone who is a better artist than I am should do a fairy picture based on this one to promote more ACPI love for everyone.