Re: Help with ACPI and CPU throttling
Le dimanche 20 février 2005 à 15:50 +0530, Ritesh Raj Sarraf a écrit :
> Okay! I had tried that earlier but that took me to a much more worse state.
> As I said, I'm able to suspend-to-RAM and I think it resumes also but no video
> output comes up. Yes, you might say that the X video drivers are buggy but I
> tried it on the console too stopping the X server and unloading any dri
> modules. But still I don't get the video.
> I use vesafb at the console too. Could that be the reason ??
I am having many problems getting my laptop to sleep also. Now I get to
suspend it to RAM and back, but my network card is gone (in a way I
cannot get it back) when I do it. Anyway, I can get it back, which is
kind of cool :-)
As you will see, I have to stop a lot of things manually before I can
initiate the suspend to RAM.
$ cat /etc/acpi/sleep.sh
# Initiates a suspend to memory [when sleep button is pressed]
/etc/init.d/mysql stop # wouldn't stop by itself
touch /tmp/suspended # see powerbtn handling
rmmod eth1394 # trying to get my network card to
#rmmod ieee1394 # "survive" the suspend-to-RAM
rmmod ipw2200 # wireless card driver
echo mem > /sys/power/state
insmod ehci_hcd &
insmod uhci_hcd &
insmod ipw2200 &
#insmod ieee1394 &
insmod eth1394 &
/etc/init.d/hotplug start &
/etc/init.d/mysql start &
/usr/sbin/ifup eth0 &
) 2>&1 | logger -t 'acpi-sleep' &
$ cat /etc/acpi/powerbtn.sh
# Initiates a shutdown when the power button has been
# Test if the computer is in suspended mode right now
if [ ! -f /tmp/suspended] ; then
# Not in suspended mode -> shutdown
if ps -Af | grep -q '[k]desktop' && test -f /usr/bin/dcop
dcop --all-sessions --all-users ksmserver ksmserver
logout 0 2 0 && exit 0 # only for KDE (dcop is a KDE app)
/sbin/shutdown -h now "Power button pressed"
# It is in suspended mode -> do nothing but come back from
# (handled by sleep.sh)
rm -f /tmp/suspended
You can probably get several bits from this.
The whole /tmp/suspended file stuff is to allow a different behaviour
for the powerbtn whether you were in suspend-to-RAM or in normal state.