Ubuntu Hardy Fan Control and Power Management

I have a MacBookPro on which I run Ubuntu. I've had a rather dubious history with my MacBookPro and it knows the Genius Bar well. Not because I need help, but because it has had more hardware problems than I care to remember. The biggest problem though is it would have burned my lap off if I had used it as a "laptop".

That being said, Hardy was a great update. It gave me fan control (previously I had to boot to OS X, let the fan widget fix the speed, then restart to Ubuntu). Suspend works! Hibernate works!

I added the following to /etc/rc.local:


#!/bin/bash
...
echo 6200 > /sys/devices/platform/applesmc.768/fan1_min
echo 6200 > /sys/devices/platform/applesmc.768/fan2_min

This put the fans at their highest speed on start. It did not however help me after suspend or hibernate. For that I had to add the same script to /etc/pm/sleep.d/91-fans. It is only slightly different:


case "$1" in
resume|thaw)
echo "ran fan script"
echo 6200 > /sys/devices/platform/applesmc.768/fan1_min
echo 6200 > /sys/devices/platform/applesmc.768/fan2_min
echo "finished running fan script"
;;
esac

exit $?

My laptop is now incredibly cool. I can lower the fan speed for power reasons but I'm usually plugged in.