One of the cool features in a Thinkpad is IBM Active Protection System.
The system consist of two parts. The driver that enables reading the acceleration data and some sort of userspace software that does the actual parking of the harddrive heads, usually hdapsd.
The hdaps driver is part of the kernel but the driver maintainers actually recommend using the tp-smapi driver instead. So that’s what we’ll do.
Make sure you have the necessary tools installed:
1 |
sudo aptitude install build-essential module-assistant |
The tp-smapi is in the package repository (universe):
1 |
sudo m-a a-i tp-smapi |
This will fetch and install the tp-smapi-source package, unpack the source and then compile and install the kernel module.
Try loading it:
1 2 |
sudo modprobe tp_smapi sudo modprobe hdaps |
The kernel log should show something like this:
1 2 3 4 5 6 7 8 |
[ 4504.896887] tp_smapi 0.40 loading... [ 4504.897178] tp_smapi successfully loaded (smapi_port=0xb2). [ 4532.702289] hdaps: initial mode latch is 0x05 [ 4532.702442] hdaps: setting ec_rate=250, filter_order=2 [ 4532.702674] hdaps: device successfully initialized. [ 4532.702788] input: ThinkPad HDAPS joystick emulation as /devices/virtual/input/input22 [ 4532.728212] input: ThinkPad HDAPS accelerometer data as /devices/virtual/input/input23 [ 4532.756552] hdaps: driver successfully loaded. |
For some reason some configuration for udev is missing. Fix this by running:
1 |
echo 'KERNEL=="event[0-9]*", ATTRS{phys}=="hdaps/input1",ATTRS{modalias}=="input:b0019v1014p5054e4801-*",SYMLINK+="input/hdaps/accelerometer-event"' | sudo tee /etc/udev/rules.d/51-hdaps.rules |
Now for the userspace stuff. First let us test if APS is actually working.
1 |
sudo aptitude install hdaps-utils |
This will install hdaps-pivot or hdaps-gl which you can use to verify that the sensors are working.
You can also test this by running this in your terminal (stop it with pressing CTRL + C):
1 |
sudo hdapsd -d sda -s 15 -a -v -y |
Next we need to update the hdapsd. The one provided in Jaunty is old. There is a PPA with newer versions.
1 2 3 4 |
cat | sudo tee /etc/apt/sources.list.d/hdapsd.list << EOF deb http://ppa.launchpad.net/jonasped/ppa/ubuntu jaunty main deb-src http://ppa.launchpad.net/jonasped/ppa/ubuntu jaunty main EOF |
Add the PPA key:
1 |
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 45EA2DEACE74152B61554DE4036A90F2BEFC6EB4 |
Update the package list and install the package:
1 2 |
sudo aptitude update sudo aptitude install hdapsd |
Install gnome-hdaps-applet (optional).
There is a PPA for this. You can add it like this:
1 2 3 4 |
cat | sudo tee /etc/apt/sources.list.d/gnome-hdaps-applet.list << EOF deb http://ppa.launchpad.net/whoopie79/ppa/ubuntu jaunty main deb-src http://ppa.launchpad.net/whoopie79/ppa/ubuntu jaunty main EOF |
Add the key:
1 |
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com e1c344a23bb057ff1d4d80cf8c236986e1ecdbb2 |
Update the package list again and install the packages:
1 2 |
sudo aptitude update sudo aptitude install gnome-hdaps-applet |
Enjoy!