On Thu, 2004-10-21 at 09:56 -0400, Siddhartha Basu wrote: > Glad you got that working. > Now how are you reloading you usb modules when it gets back from > hibernation. How does your script sense hibernation, is it a daemon > running in the backgroud. > And what version of kernel + patchset you are using.
Basically I am using ACPID to do all the stuff. ACPID lets you map events like power button press, AC adapter unplugging, lid closure, etc to specific commands (man acpid for details). Just for example - I have mapped my lid closure to a script which puts the computer in suspend to RAM state - here's the script: ************************************************************************* #!/bin/bash # Ugly hack to prevent machine from hibernating while resuming touch /tmp/suspend.state #Unload the ehci_hcd module /sbin/rmmod ehci_hcd #Now go to sleep echo mem > /sys/power/state ### Script is suspended at this stage ### #The things below this line will be executed after wakeup #Load ehci_hcd module /sbin/modprobe ehci_hcd **************************************************************************** This file is called /etc/acpi/actions/lid.sh While there is another file in /etc/acpi/events/lid which says ***************************************************************************** event=button/lid.* action=/etc/acpi/actions/lid.sh ****************************************************************************** While the lid is opened - for some reason - there is a powerbutton event generated - and the powerbutton is set to take the machine in suspend to disk state. So to prevent the machine from going into suspend to disk - I am using the file /tmp/suspend.state - and has included a simple test in /etc/acpi/actions/pwrbtn.sh which makes the script delete the /tmp/suspend.state file and exit if latter is found to exist. In Gentoo - you can get acpid by doing emerge acpid. I am using gentoo-dev-sources (kernel 2.6.9-gentoo) along with the software suspend 2.1 patchset from the software suspend site (http://softwaresuspend.berlios.de/) -hth- Sayamindu -- To unsubscribe, send mail to [EMAIL PROTECTED] with the body "unsubscribe ilug-cal" and an empty subject line. FAQ: http://www.ilug-cal.org/node.php?id=3
