[ltp] ACPI sleep.sh on T41 2373-2FG.

Jean Jordaan linux-thinkpad@linux-thinkpad.org
Sun, 13 Mar 2005 18:34:48 +0200


Hi all

It looks like I have suspend working OK on my T41 2373-2FG. (Dunno if 
drain-while-sleep bites me yet.) Here's the /etc/acpi/sleep.sh I hacked
together from here and there. Advice (as in "why do that, it's totally
useless", or "you've forgotten to do this, your system will die!") is
gratefully solicited.

"""
#!/bin/sh
echo "7 blink" >/proc/acpi/ibm/led
echo "4 off" >/proc/acpi/ibm/led
logger "Suspending to RAM"
# /etc/init.d/ifplugd stop  # still interferes with my adsl connection
/etc/init.d/hotplug stop    # "Stopping a boot service" msg (ignored)
# /etc/init.d/cpufreqd stop # I use powernowd.
/etc/init.d/powernowd stop
# /bin/killall dhcpcd       # I don't use DHCP.
/etc/init.d/alsasound stop  # "Stopping a boot service" msg (ignored)
# /etc/init.d/pcmcia stop
rmmod uhci-hcd              # Don't really know what I'm doing here
rmmod ehci-hcd
radeontool light off
sync
# rmmod ath_pci ath_hal wlan # I haven't configured wifi yet :/
hwclock --systohc           # Might not need this?
echo 3 > /proc/acpi/sleep
# modprobe ath_pci
echo "4 on" >/proc/acpi/ibm/led
echo "7 off" >/proc/acpi/ibm/led
radeontool light on
logger "Resuming from RAM suspend"
modprobe ehci-hcd
modprobe uhci-hcd
hwclock --hctosys
# /etc/init.d/ifplugd start
# /etc/init.d/cpufreqd start
/etc/init.d/powernowd start
/etc/init.d/hotplug start
/etc/init.d/alsasound start
# /etc/init.d/pcmcia start
"""

Here's the default /etc/acpi/default.sh
from Gentoo. I just added the 'lid' option, and pointed it at the above 
script.

"""
#!/bin/sh
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: 
/var/cvsroot/gentoo-x86/sys-apps/acpid/files/acpid-1.0.4-default.sh,v 
1.1 2004/10/19 08:07:45 brix Exp $

# Default acpi script that takes an entry for all actions

set $*

group=${1/\/*/}
action=${1/*\//}

case "$group" in
         button)
                 case "$action" in
                         power)  /sbin/init 0
                                 ;;
                         lid)    exec /etc/acpi/sleep.sh
                                 ;;
                         *)      logger "ACPI action $action is not defined"
                                 ;;
                 esac
                 ;;

         *)
                 logger "ACPI group $group / action $action is not defined"
                 ;;
esac
"""

-- 
Jean