Install tp_smapi in openSuse 11.1 using either YAST Software Manager or 1-click Install
(this will enable updates to be performed)
Note1: This installation was performed on a Lenovo W500
running openSuse 11.1 64bit kernel 2.6.27.23-0.1-default
(HDAPS was not active so additional work will be necessary if you have HDAPS active)
you can use the following command in gnome terminal to check if HDAPS is active:
# lsmod|egrep 'hdaps'
(should result in no results if HDAPS is NOT active)
Note2: This installation was performed by a relatively newbie to Linux
(hence the detailed step-by-step instructions)
LOG IN AS ROOT
Perform either step1 or step2 then continue to step 3.
YAST Software Manager install option
1a. check if the following respository URL is already listed in the Software Repositories by performing the following:
i. click Computer
ii. click YaST
iii. click Software (in left menu)
iv. click Software Repositories
v. search for the following repository:
pty99(Default) enabled=y autorefresh=y
Name: openSUSE:Factory:Contrib
URL: [Index of /repositories/openSUSE:/Factory:/Contrib/openSUSE_11.1](http://download.opensuse.org/repositories/openSUSE:/Factory:/Contrib/openSUSE_11.1/)
Category: YUM
if it is not listed...
vi. click the ADD button to include it
vii. tick the option 'specify url'
viii. give it the name 'openSUSE:Factory:Contrib' and enter the url of
[Index of /repositories/openSUSE:/Factory:/Contrib/openSUSE_11.1](http://download.opensuse.org/repositories/openSUSE:/Factory:/Contrib/openSUSE_11.1/)
1b. open Software Management and search for tp_smapi in the ‘available’ section
1c. select the relevent tp_smapi for your installed kernel and click the install button.
(default kernel = tp_smapi-kmp-default)
1-click Install option
2a. use the search function in Software.openSUSE.org
to search for tp_smapi and download the 1-click install .ymp file relevent for your installed kernel
(default kernel = tp_smapi-kmp-default.ymp)
2b. install tp_smapi by double clicking the downloaded .ymp file (default kernel = tp_smapi-kmp-default.ymp)
The installation of the necessary module packages is now complete.
add the following line to file /etc/modprobe.conf.local (is required on T400/T500/W500):
options thinkpad_ec force_io=1
Note: if using HDAPS, you may need to precede the ‘options thinkpad_ec force_io=1’ line
with the line ‘options hdaps hdaps=1’ (without the quotes) but I cannot confirm if this is the correct command.
check which modules are loaded by using the following command in gnome terminal:
lsmod|egrep ‘hdaps|thinkpad_ec|tp_smapi’
(should result in no results if none of the modules are loaded)
manually perform a test load of the tp_smapi module using the following command in gnome terminal:
modprobe tp_smapi
(should produce no errors if it loaded successfully)
Note: if using HDAPS, the above command would be:
# modprobe tp_smapi hdaps
recheck which modules are loaded by using the following command in gnome terminal:
lsmod|egrep ‘hdaps|thinkpad_ec|tp_smapi’
(should result in something similar to if HDAPS is not loaded:
tp_smapi 26832 0
thinkpad_ec 7664 1 tp_smapi
)
use the following command in gnome terminal to display the current start & stop battery charge threshold %ages:
enable the tp_smapi module to autoload on boot by…
changing the following line in file /etc/sysconfig/kernel
from
MODULES_LOADED_ON_BOOT=""
to
MODULES_LOADED_ON_BOOT=“tp_smapi”
(or if using HDAPS - MODULES_LOADED_ON_BOOT=“tp_smapi hdaps”)
Installation is now complete.
Credits: Many thanks to member escaner (Oscar) for introducing me to some very useful commands and his explanations regarding kernel versions and rpm files. I would not have been able to install tp_smapi without his help.
I now have hdaps functioning too. Please see the revisions to steps 4,6,7,12 below:
add the following line to file /etc/modprobe.conf.local (is required on T400/T500/W500):
options thinkpad_ec force_io=1
Note: the tp_smapi wiki mentions the following 2 commands when installing from the source file:
# make load HDAPS=1
# make install HDAPS=1
no reference to 'HDAPS=1' is needed in file /etc/modprobe.conf.local
because this was handled by the install methods detailed above (see steps 1 & 2).
manually perform a test load of the module(s)
6a. to only load tp_smapi, use the following command in gnome terminal:
# modprobe tp_smapi
(should produce no errors if it loaded successfully)
6b. to load both tp_smapi & hdaps, use the following command in gnome terminal:
# modprobe tp_smapi hdaps
(should produce no errors if they loaded successfully)
Note: you can investigate any error messages further by using the command below:
# dmesg |egrep ‘(smapi|hdaps)’
recheck which modules are loaded by using the following command in gnome terminal:
lsmod|egrep ‘hdaps|thinkpad_ec|tp_smapi’
if HDAPS is NOT loaded, it should result in something similar to:
tp_smapi 26832 0
thinkpad_ec 7664 1 tp_smapi
if HDAPS is loaded, it should result in something similar to:
hdaps 12356 0
tp_smapi 26832 0
thinkpad_ec 7664 2 hdaps,tp_smapi
enable tp_smapi (and hdaps if required) to autoload on boot by…
changing the following line in file /etc/sysconfig/kernel
from
MODULES_LOADED_ON_BOOT=""
to
MODULES_LOADED_ON_BOOT=“tp_smapi” (to only load tp_smapi)
MODULES_LOADED_ON_BOOT=“tp_smapi hdaps” (to load both tp_smapi & hdaps)
Nice write up. I already have those 3 modules loading on my X60s. The problem is that it’s not enough to have HDAPS working fully, i.e. it won’t part the HDD - well not on mine at least. There is a wiki about APS but it’s a little old and I can’t quite figure it out :shame:
Yes, you are correct. I should have said that it enables the HDAPS module to be loaded rather than stating I have HDAPS functioning. I now realise that I don’t :\
I installed the gnome-hdaps-applet GUI monitoring tool and it reports an error so I promptly went back to the HDAPS wiki and noticed that the ‘hdapsd userspace daemon’ is required.
I’m not too concerned about getting HDAPS functioning as yet because I’ve got a more annoying issue … openSuse keeps freezing on me and /var/log/messages is not helping me too much at the moment, but I’m thinking it’s possibly due to ATI’s fglrx and desktop effects being enabled. More meddling to be done
If/when i get back to HDAPS i’ll post any findings.
I installed the one with the most recent date but still not got it working. I’m very new to Linux so don’t fully understand daemons, modules, etc and how they are loaded, executed etc.
Unfortunately, I’m in the same boat as you (I’ve only been using linux for a few months) so it’s like the blind trying to lead the blind :\
However, I notice there’s a 1-click install option available on Software.openSUSE.org
I used the 1-click install option to install tp_smapi and it worked a treat (no need to compile) so the same principle should almost certainly apply with the HDAPS 1-click install. And if it’s 1-click install I’d be surprised if it did not actually do the kernel patch.
Using the following command (that member escaner introduced me to) to display the contents of the hdapsd-20090401-7.1.x86_64.rpm file:
rpm -qp hdapsd-20090401-7.1.x86_64.rpm -l
I see that the rpm file contains the following:
/etc/init.d/hdaps
/usr/sbin/hdapsd
/usr/share/doc/packages/hdapsd
/usr/share/doc/packages/hdapsd/ChangeLog
/usr/share/doc/packages/hdapsd/README
/usr/share/man/man8/hdapsd.8.gz
I wonder if it’s possible to extract the README file from the rpm without running the rpm to see what it says? It may give some clues as to what the rpm actually does. Me being a newbie, I’d rather take the plunge with the 1-click install. As soon as I’ve got the freeze sorted I’ll do a backup image of my suse partition before giving the 1-click install a go and let you know the results.
I managed to extract the README file from the latest rpm file. Unfortunately it states the kernel will have to patched. Below is the contents of the README file:
hdapsd - Hard Drive Active Protection System Daemon
This is a disk protection user-space daemon. It monitors the acceleration
values through the HDAPS/AMS interfaces and automatically initiates disk head
parking if a fall or sliding of the laptop is detected.
Compilation
./configure
make
make install
Usage
hdapsd (it will try to autodetect everything itself)
for more options, please read man hdapsd
Compatibility
Since kernel 2.6.28 you don’t need to patch your kernel, as support for
IDLE_IMMEDIATE is present in mainline.
NOTE: The new interface only allows IDLE_IMMEDIATE for drives that
announce to be ATA-7 conform. But threre are also drives that
support ATA-6 only but do IDLE_IMMEDIATE fine. For those you
need to force the interface with:
echo -1 > /sys/block/$DISK/device/unload_heads
OR: Call hdapsd like this: hdapsd -f -d $DISK
For kernels <2.6.28, please have a look at HDAPS - ThinkWiki
and patch your kernel with the appropriate patch before using hdapsd.
mainline hdaps module vs tp_smapi
The mainline hdaps module present in Linux kernels does not support all
hdaps-enabled ThinkPads, thus it is recommended to use the one provided
by tp_smapi.
Additionally the tp_smapi version provides a input interface to the data,
which stops hdapsd from polling the data itself all the time, saving your
battery.
I’ve already done the HDAPS 1 click install. I posted a link to it earlier. As you say, it still requires the kernel to be patched. This is where I’m stumped. It looks simple enough when reading through the instructions but what are the risks. Am I likely to stuff the system?
also would i need to repatch the kernel everytime there is a new kernel update until we get to 2.6.28? Just some of the questions going round in my head at the moment.
Just wanted to update that I successfully configured both on T60p running 11.2. You should see something like this in the syslog when your laptop shakes…
I use opensuse11.4 x86_64 in thinkpad W500 .
I installed tp_smapi-kmp-default and tp_smapi-kmp-desktop .
I just use URL: Index of /repositories/openSUSE:/11.4:/Contrib/standard , not factory .
When I loaded tp_smapi , it said can not find that file .