Suspend to RAM on a Hewlett-Packard Compaq nx6110 laptop with Debian Sarge - 14/04/2006
Ok, I apologize for the very nerdy post, but I'm sure it'll prove to be a lot more useful both to me (as a reminder) and to others than anything I've been writing here so far. It's the kind of documentation I would have liked to find 2 hours ago since it would have saved (most of) my evening. But anyway, here's how you can have your laptop to suspend-to-RAM with Debian Sarge. For Fedora, see Leonid's instructions.
I'm using kernel 2.6.16.5, the hibernate package and acpid (apt-get install hibernate acpid).
First of all, let's make sure we can have the laptop to go to sleep. Edit /etc/hibernate/hibernate.conf. Uncomment 'UseSysfsPowerState mem' (line 49 in my case), and comment everything else above this line. I didn't try the first method (software suspend) and the third one (acpi_sleep) didn't work for me : hibernate would complain about on ACPI not being built in the kernel although I did compile it in. Save the file and run 'hibernate'. Your laptop should go to sleep within a matter of seconds. Press the power button to bring it back to life.
Now, immediately after waking up, your laptop may start shutting down. That's because we had to press the power button to wake up the laptop. By default, acpid will intercept the power button press event and trigger a shutdown sequence. I solved this by editing /etc/acpi/events/powerbtn. Just comment out the line that says 'action=/etc/acpi/powerbtn.sh' (line 13 in my case). Don't worry, you can still power off the laptop through your display manager (kdm, xdm, gdm) or the command line (shutdown -fh now).
To have your laptop suspend when you close the lid, just append these two lines to /etc/acpi/events/powerbtn :
event=button/lid
action=/usr/sbin/hibernate
If you have a different laptop, you can get the event code for any event of interest (e.g. lid close) from /var/log/acpid. I'm not sure wether this is the right place for these two lines : it would have been cleaner to create a 'lid' script in /etc/acpi/events. But it worked for me so there's no reason why it shouldn't work for you...
There is one issue I couldn't solve though. I have a Ralink RT2500-based wireless LAN card. I've been using the rt2x00 driver with no trouble so far but if I suspend-to-RAM the laptop while leaving the PCMCIA card in the slot, the laptop fails to wake up. The screen just stays black and the numlock LED blinks while the laptop stays asleep. All I can do is turn it off and on again using the power button. But taking out the wireless PCMCIA card before suspending the laptop seems to be a satisfying workaround.
Hope that helps !
I'm using kernel 2.6.16.5, the hibernate package and acpid (apt-get install hibernate acpid).
First of all, let's make sure we can have the laptop to go to sleep. Edit /etc/hibernate/hibernate.conf. Uncomment 'UseSysfsPowerState mem' (line 49 in my case), and comment everything else above this line. I didn't try the first method (software suspend) and the third one (acpi_sleep) didn't work for me : hibernate would complain about on ACPI not being built in the kernel although I did compile it in. Save the file and run 'hibernate'. Your laptop should go to sleep within a matter of seconds. Press the power button to bring it back to life.
Now, immediately after waking up, your laptop may start shutting down. That's because we had to press the power button to wake up the laptop. By default, acpid will intercept the power button press event and trigger a shutdown sequence. I solved this by editing /etc/acpi/events/powerbtn. Just comment out the line that says 'action=/etc/acpi/powerbtn.sh' (line 13 in my case). Don't worry, you can still power off the laptop through your display manager (kdm, xdm, gdm) or the command line (shutdown -fh now).
To have your laptop suspend when you close the lid, just append these two lines to /etc/acpi/events/powerbtn :
event=button/lid
action=/usr/sbin/hibernate
If you have a different laptop, you can get the event code for any event of interest (e.g. lid close) from /var/log/acpid. I'm not sure wether this is the right place for these two lines : it would have been cleaner to create a 'lid' script in /etc/acpi/events. But it worked for me so there's no reason why it shouldn't work for you...
There is one issue I couldn't solve though. I have a Ralink RT2500-based wireless LAN card. I've been using the rt2x00 driver with no trouble so far but if I suspend-to-RAM the laptop while leaving the PCMCIA card in the slot, the laptop fails to wake up. The screen just stays black and the numlock LED blinks while the laptop stays asleep. All I can do is turn it off and on again using the power button. But taking out the wireless PCMCIA card before suspending the laptop seems to be a satisfying workaround.
Hope that helps !