Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: tp_smapi on Lenovo Thinkpad T400/T500/W500 (step-by-step)

  1. #1

    Default tp_smapi on Lenovo Thinkpad T400/T500/W500 (step-by-step)

    This is a step-by-step guide on how to ....

    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.

    1. 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
    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


    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)


    2. 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)


    3. The installation of the necessary module packages is now complete.


    4. 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.


    5. 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)


    6. 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


    7. 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
    )


    8. use the following command in gnome terminal to display the current start & stop battery charge threshold %ages:
    # cat /sys/devices/platform/smapi/BAT0/*_charge_thresh


    9. use the following command in gnome terminal to set the current start battery charge threshold to 30%:
    # echo 30 > /sys/devices/platform/smapi/BAT0/start_charge_thresh


    10. use the following command in gnome terminal to set the current stop battery charge threshold to 90%:
    # echo 90 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh


    11. use the following command in gnome terminal to redisplay the current start & stop battery charge threshold %ages:
    # cat /sys/devices/platform/smapi/BAT0/*_charge_thresh


    12. 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")


    13. 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.

  2. #2

    Default Re: tp_smapi on Lenovo Thinkpad T400/T500/W500 (step-by-step

    I now have hdaps functioning too. Please see the revisions to steps 4,6,7,12 below:


    4. 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).


    6. 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)'


    7. 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


    12. 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)

  3. #3
    Join Date
    May 2009
    Location
    EU
    Posts
    1,009

    Default Re: tp_smapi on Lenovo Thinkpad T400/T500/W500 (step-by-step

    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

    Is your disk parking?
    IBM Thinkpad X60s | Intel L2400 | Intel 945GM | 3GB | openSUSE 12.3 | KDE4.10.1
    ASUS M3N78 | AMD 64x2 5400+ | nvidia 8200+ | 2GB | openSUSE 12.3 | KDE4.10.1
    Acer Aspire Revo R3610 | Atom 330 | nvidia ION | 2GB | openSUSE 12.3 | KDE4.10.1

  4. #4

    Default Re: tp_smapi on Lenovo Thinkpad T400/T500/W500 (step-by-step

    Hi suse_tpx60s,

    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.

    cheers
    Mark

  5. #5
    Join Date
    May 2009
    Location
    EU
    Posts
    1,009

    Default Re: tp_smapi on Lenovo Thinkpad T400/T500/W500 (step-by-step

    I installed the daemon from here.

    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.
    IBM Thinkpad X60s | Intel L2400 | Intel 945GM | 3GB | openSUSE 12.3 | KDE4.10.1
    ASUS M3N78 | AMD 64x2 5400+ | nvidia 8200+ | 2GB | openSUSE 12.3 | KDE4.10.1
    Acer Aspire Revo R3610 | Atom 330 | nvidia ION | 2GB | openSUSE 12.3 | KDE4.10.1

  6. #6
    Join Date
    May 2009
    Location
    EU
    Posts
    1,009

    Default Re: tp_smapi on Lenovo Thinkpad T400/T500/W500 (step-by-step

    Just had another look at this and I believe I need to do a kernel patch. No patch required from 2.6.28 onwards so opensuse being on 2.6.27 just misses

    Not sure I have the guts for that yet. I assume any subsequent kernel update will require me to repatch it or not?

    What are the risks of running this patch?
    IBM Thinkpad X60s | Intel L2400 | Intel 945GM | 3GB | openSUSE 12.3 | KDE4.10.1
    ASUS M3N78 | AMD 64x2 5400+ | nvidia 8200+ | 2GB | openSUSE 12.3 | KDE4.10.1
    Acer Aspire Revo R3610 | Atom 330 | nvidia ION | 2GB | openSUSE 12.3 | KDE4.10.1

  7. #7

    Default Re: tp_smapi on Lenovo Thinkpad T400/T500/W500 (step-by-step

    Hi,

    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.

  8. #8

    Default Re: tp_smapi on Lenovo Thinkpad T400/T500/W500 (step-by-step

    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.

    1. Compilation
    --------------
    ./configure
    make
    make install

    2. Usage
    --------
    hdapsd (it will try to autodetect everything itself)
    for more options, please read man hdapsd

    3. 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.

    4. 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.

  9. #9
    Join Date
    May 2009
    Location
    EU
    Posts
    1,009

    Default Re: tp_smapi on Lenovo Thinkpad T400/T500/W500 (step-by-step

    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.
    IBM Thinkpad X60s | Intel L2400 | Intel 945GM | 3GB | openSUSE 12.3 | KDE4.10.1
    ASUS M3N78 | AMD 64x2 5400+ | nvidia 8200+ | 2GB | openSUSE 12.3 | KDE4.10.1
    Acer Aspire Revo R3610 | Atom 330 | nvidia ION | 2GB | openSUSE 12.3 | KDE4.10.1

  10. #10

    Default Re: tp_smapi on Lenovo Thinkpad T400/T500/W500 (step-by-step)

    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...

    Apr 29 02:10:53 jjaimon-ibm hdapsd[30665]: parking
    Apr 29 02:10:54 jjaimon-ibm hdapsd[30665]: un-parking

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •