Active Protection on Linux

Solaris, RedHat, FreeBSD and the like
Post Reply
Message
Author
hsjC
Freshman Member
Posts: 54
Joined: Thu Sep 21, 2006 11:28 am
Location: San Francisco, CA, US

Active Protection on Linux

#1 Post by hsjC » Mon Dec 11, 2006 10:18 pm

Hi people,

Just want to know if anyone has successfully configured the active protection of the harddrive, aka hdaps, on any linux distro's for new series like T60 and the Z6X.

I got almost everything except this protection to work on my z61t with Fedora Core 6.

Thanks in advance!
Recursion:
See: Recursion.

seneca
Sophomore Member
Posts: 173
Joined: Tue Jan 31, 2006 1:27 pm
Location: Stockholm, Sweden

#2 Post by seneca » Tue Dec 12, 2006 2:40 am

I think the Z61t have the same aps as the other TP models, so follow these instructions:

http://www.thinkwiki.org/wiki/Installin ... ion_System

I've gotten it to work on my X40.
Thinkpad x220 Li7-2620M 8gb/80gb mSATA intel 320SSD/160gb Intel 330 (didn't fit, had to remove the aluminium shell)
Linux Mint 17

magnus
Posts: 34
Joined: Mon Jul 31, 2006 6:21 am
Location: Norway

#3 Post by magnus » Tue Dec 12, 2006 2:54 pm

I have it running on my Z61t running Gentoo.

I used the basic installation instructions on thinkwiki.org.

Edit: If you have the hardware encryption running, I'd be very interested in hearing how you went about getting up and running.

hsjC
Freshman Member
Posts: 54
Joined: Thu Sep 21, 2006 11:28 am
Location: San Francisco, CA, US

#4 Post by hsjC » Tue Dec 12, 2006 2:57 pm

Hm.... interesting...

I did follow the exact guide to configure it on thinkwiki.org
But "modproge hdaps" gives me a "No such device error" so I started wondering maybe my z61t is not supported by that module yet.

I'll try again later. Thanks guys.

By the way, I don't have hardware encryption on, don't need it for now. :P
Recursion:
See: Recursion.

magnus
Posts: 34
Joined: Mon Jul 31, 2006 6:21 am
Location: Norway

#5 Post by magnus » Tue Dec 12, 2006 3:03 pm

hsjC wrote: I did follow the exact guide to configure it on thinkwiki.org
But "modproge hdaps" gives me a "No such device error" so I started wondering maybe my z61t is not supported by that module yet.
It would give that error if hdaps was compiled into the kernel or if it wasn't compiled at all.

hsjC
Freshman Member
Posts: 54
Joined: Thu Sep 21, 2006 11:28 am
Location: San Francisco, CA, US

#6 Post by hsjC » Tue Dec 12, 2006 5:07 pm

magnus wrote:
hsjC wrote: I did follow the exact guide to configure it on thinkwiki.org
But "modproge hdaps" gives me a "No such device error" so I started wondering maybe my z61t is not supported by that module yet.
It would give that error if hdaps was compiled into the kernel or if it wasn't compiled at all.
Sorry Magnus, I didn't quite follow your post. Do you mean that if hdaps is compiled into the kernel, there should not be any errors?
Recursion:
See: Recursion.

magnus
Posts: 34
Joined: Mon Jul 31, 2006 6:21 am
Location: Norway

#7 Post by magnus » Tue Dec 12, 2006 7:00 pm

First off let me say that my guess is that it's not compiled with the kernel at all, and that you'd most likely need a custom kernel in order to be able to use it. At the moment I won't go into that , because I don't think I have time to follow it up ;)

An easy way would be to load up windows and see if the active protection works there. If it does, then it's a linux thing.

Then comes the rest...

When you compile the kernel, it's possible to either compile it into the kernel, as a module or not at all. That goes for pretty much any feature. If it's compiled into the kernel, and you try to load it as a module, it will give an error because there's no module.

If it's compiled into the kernel, you should have a device at '/sys/devices/platform/hdaps'. If it's not there, it's not compile dinto the kernel.

Basically you need support for hdaps compiled either as a kernel or a module with the kernel in order to get support.

In addition you need a harddrive flashed with appropriate firmware. (If it's factory installed it's probably already flashed with appropriate firmware).

hsjC
Freshman Member
Posts: 54
Joined: Thu Sep 21, 2006 11:28 am
Location: San Francisco, CA, US

#8 Post by hsjC » Wed Dec 13, 2006 3:22 pm

Just checked, it's not compiled into the kernel. But I do have a hdaps.ko file within /lib/modules/...../kernel/drivers/hwmon/
And when I try "modprobe hdaps", it gives me the "no such device error"
That's why I am guessing my model is somehow not supported.
Did you guys install those software suspend patches first before hdaps works?
Recursion:
See: Recursion.

jasonxh
Posts: 14
Joined: Fri Sep 29, 2006 11:58 pm
Location: Canada

#9 Post by jasonxh » Wed Dec 13, 2006 5:41 pm

hsjC wrote:Just checked, it's not compiled into the kernel. But I do have a hdaps.ko file within /lib/modules/...../kernel/drivers/hwmon/
And when I try "modprobe hdaps", it gives me the "no such device error"
That's why I am guessing my model is somehow not supported.
Did you guys install those software suspend patches first before hdaps works?
I don't see any connection between software suspend and hdaps. hdaps works for me out of the box, without any patches. I'm running Ubuntu Edgy on a T60.

In fact I've just patched the kernel and get the queue freezing working (which I take as the only reason hdaps should exist), though not working very well. It locks up the whole system from time to time, especially during high IO, and I can do nothing but press the power button... :( Seems the patch has got some problem itself

Anyone has successful experience with queue freezing?

hsjC
Freshman Member
Posts: 54
Joined: Thu Sep 21, 2006 11:28 am
Location: San Francisco, CA, US

#10 Post by hsjC » Wed Dec 13, 2006 7:06 pm

I am gonna try debian instead of fedora. Besides hdaps problem, fedora won't put my z61t into suspend/hibernate. It generates a soft lockup on cpu error. Very annoying.

jasonxh, could you please check if hdaps is compiled into your kernel, or it's loaded as a module? And, is ur wireless working? Suspend/hibernate and all that?
Recursion:
See: Recursion.

jasonxh
Posts: 14
Joined: Fri Sep 29, 2006 11:58 pm
Location: Canada

#11 Post by jasonxh » Wed Dec 13, 2006 7:19 pm

hdaps is compiled as a module. My wireless works also out of the box. The stock version of suspend/hibernate is not very stable, but it "occasionally" works... so I switched to Suspend2, which is much more stable for me, but the hibernate UI is not working yet...

BTW, I have to mention that I modified the code of hdaps to get the axis right on my T60. I have to swap x and y axes, and also invert y-axis. It's not that important though.

hsjC
Freshman Member
Posts: 54
Joined: Thu Sep 21, 2006 11:28 am
Location: San Francisco, CA, US

#12 Post by hsjC » Wed Dec 13, 2006 7:32 pm

Thanks, jasonxh.

For some reason I don't even know, I don't want to use ubuntu. :P
So for hdaps, you just installed the hdapsd daemon and it just works?

I heard hdaps is compiled into the kernel from 2.6 on, but indeed it's a module on my fc6, and I can't load it... :(
Recursion:
See: Recursion.

jasonxh
Posts: 14
Joined: Fri Sep 29, 2006 11:58 pm
Location: Canada

#13 Post by jasonxh » Wed Dec 13, 2006 7:47 pm

You're welcome. Sometimes personal preference is just too mysterious to find a reason for. :)

It seems to me that you have some misunderstandings of my post. hdaps is simply an interface to get the position data, and you can use hdaps-gl to visualize it. It doesn't give you the power to freeze IO queue of your disk, which hdapsd heavily depends on. You will have to patch your kernel for this. And as I've said, I just tried, but it seems the patch I found wasn't very stable.

I'm a total newbie myself, so I'm not very clear what your problem is. Maybe you can have a try with dmesg?

hsjC
Freshman Member
Posts: 54
Joined: Thu Sep 21, 2006 11:28 am
Location: San Francisco, CA, US

#14 Post by hsjC » Thu Dec 14, 2006 12:31 am

Ah... debian is just too much for a newbie like me...

Jason, could you plz describe what you did to make hdaps work? Like, in steps, what did you install/configure?
Recursion:
See: Recursion.

jasonxh
Posts: 14
Joined: Fri Sep 29, 2006 11:58 pm
Location: Canada

#15 Post by jasonxh » Thu Dec 14, 2006 1:27 am

I really did nothing, but simply "sudo modprobe hdaps"... However if you meet the axis problem like me, then perhaps you will have to modify linuxsource/drivers/hwmon/hdaps.c and do a kernel module compile.

Ok, to make it clear, first you run

Code: Select all

modinfo hdaps
to make sure the module is correctly installed. Then run

Code: Select all

sudo modprobe hdaps
to load the module. If nothing turns up, you should have succeeded. If anything goes wrong, try

Code: Select all

dmesg|grep hdaps
and post the output here. Maybe someone will be able to help with the extended information.

When you have loaded the module, you can run

Code: Select all

hdaps-gl
to see a visualization of it, and also to check if you have the axis problem like me :(

Hope it helps.

hsjC
Freshman Member
Posts: 54
Joined: Thu Sep 21, 2006 11:28 am
Location: San Francisco, CA, US

#16 Post by hsjC » Thu Dec 14, 2006 2:22 am

Thanks Jason, dmesg gives me:

hdaps: supported laptop not found!
hdaps: driver init failed (ret=-19)!

Yeah, looks like it doesn't support my z61t. I guess this module from fedora core is too old or something...
Recursion:
See: Recursion.

jasonxh
Posts: 14
Joined: Fri Sep 29, 2006 11:58 pm
Location: Canada

#17 Post by jasonxh » Thu Dec 14, 2006 3:30 pm

Maybe you can post the result to Fedora forums to ask for help then. It should not be a big deal I guess.

Wish you good luck. :P

hsjC
Freshman Member
Posts: 54
Joined: Thu Sep 21, 2006 11:28 am
Location: San Francisco, CA, US

#18 Post by hsjC » Sun Dec 17, 2006 3:38 am

Fedora forum sux.... Not many fedora gurus go there I guess.

I tried with Ubuntu, hdaps works beautifully.... :(
Why fedora...why...

Anyway, I tried copying the hdaps.ko file from ubuntu to my fedora, it gave me a "invalid format" error. Is there a way to force linux to load that module, or, edit the file a bit so that the system would think it's the "valid" format?
Recursion:
See: Recursion.

jasonxh
Posts: 14
Joined: Fri Sep 29, 2006 11:58 pm
Location: Canada

#19 Post by jasonxh » Sun Dec 17, 2006 8:05 pm

I suggest you try this source
http://sourceforge.net/project/showfile ... _id=171579
It's tp_smapi actually, but it includes a patched version of hdaps (the original version conflicts with tp_smapi, and Ubuntu is using this patched version). After unpacking it, try

Code: Select all

sudo make install HDAPS=1
and it will remove currently installed version (if any) and install these two modules for you. If everything goes smoothly, just modprobe it and enjoy!

hsjC
Freshman Member
Posts: 54
Joined: Thu Sep 21, 2006 11:28 am
Location: San Francisco, CA, US

#20 Post by hsjC » Mon Dec 18, 2006 12:07 am

Thanks very much Jason, that solved my hdaps problem. At least now the module loads properly.

Now i think I need to patch the kernel or something, cuz hdapsd says I'm missing a protect_file. I'll be working on that.
Recursion:
See: Recursion.

jasonxh
Posts: 14
Joined: Fri Sep 29, 2006 11:58 pm
Location: Canada

#21 Post by jasonxh » Mon Dec 18, 2006 1:33 pm

Good to hear that. :) So you don't have the axis problem then? Lucky you. :D

Now that you decide to patch the kernel for queue freezing, I would like to tell you some of my recent experience with that. I suggest you use start with a vanilla kernel from kernel.org. I've tried it before with the "Ubuntulized" 2.6.17 kernel which turned out very unstable after the patch, and then I tried the 2.6.19 from kernel.org and it works beautifully. The BIG disadvantage is that you gonna lose your Fedora specific patches unless you manually do them yourself. Anyway, I'm very happy with my current kernel. So the choice is up to you, or you can give them both a try anyway.

hsjC
Freshman Member
Posts: 54
Joined: Thu Sep 21, 2006 11:28 am
Location: San Francisco, CA, US

#22 Post by hsjC » Mon Dec 18, 2006 4:22 pm

Actually, now that you mentioned it, I didn't even check the axis thing.
How would you tell if you have that problem by running hdaps-gl?
Does it explicitly tell you that?

Edit: Oh, now I remember that I tried to compile hdaps-gl. It told me I don't have gl libraries or something.
Recursion:
See: Recursion.

jasonxh
Posts: 14
Joined: Fri Sep 29, 2006 11:58 pm
Location: Canada

#23 Post by jasonxh » Mon Dec 18, 2006 4:54 pm

You don't have precompiled version in Fedora repository? I didn't compile it from source, so I'm not clear what libs it needs. By looking at package deps in Ubuntu repo, I guess you could try installing these libs (package names in Ubuntu repo):
  • freeglut3-dev
    libgl1-mesa-dev
    libglu1-mesa-dev
As long as you you have hdaps-gl running, you will know what I mean by "axis problem". If you don't notice anything unusual, then congratulations, you are out of trouble. It doesn't matter so much anyway. Wrong axis won't have any influence on hdapsd, but just a funny visual effect with hdaps-gl. 8)

hsjC
Freshman Member
Posts: 54
Joined: Thu Sep 21, 2006 11:28 am
Location: San Francisco, CA, US

#24 Post by hsjC » Mon Dec 18, 2006 5:05 pm

You the man Jason!! :D

After installing freeglut, hdaps-gl compiles and runs flawlessly. I also compiled another gnome applet called "tilt". Both programs show that I don't have the axis problem, hehe. The 3D picture matches perfectly with how it is physically. :P

BTW, are you having an "inverted" axis problem?

EDIT: I actually did the same thing as you, patched a 2.6.19 kernel from kernel.org but for some reason it's not booting. It couldn't find my logic volume groups. I need to compile LVM support into the kernel or something?
Recursion:
See: Recursion.

jasonxh
Posts: 14
Joined: Fri Sep 29, 2006 11:58 pm
Location: Canada

#25 Post by jasonxh » Mon Dec 18, 2006 5:23 pm

Glad that you made it! :P

The invert param in hdaps will invert the position data along each axis, i.e. (x,y) => (-x,-y). (this behavior varies among different versions of hdaps code). However, my problem is a little bit more complicated than simple inversion: I have to do this (x,y) => (y,-x). So you get it?

I just modified the code to be more general, i.e. accepting an integer param and interpreting it as three mask bits respectively for inverting x,y, and swap. This way I can get do anything I want then. :D

I think Lenovo engineers simply misplaced the device or something, since it really doesn't matter what direction it is, as long as it detects the acceleration.

jasonxh
Posts: 14
Joined: Fri Sep 29, 2006 11:58 pm
Location: Canada

#26 Post by jasonxh » Mon Dec 18, 2006 5:32 pm

You should import your original kernel options before you start compiling the new one. Just copy the config file (maybe you can locate it in /boot) to the kernel source dir, and rename it to ".config" (don't miss the dot). Then run "make oldconfig". It will scan your old options and prompt for new features that were not configured. This way you can retain your original options as much as possible. After that you can "make menuconfig" to change options as you want, and go on with the kernel compile routine.

Always be very careful when you configure kernel options!

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “Linux Questions”

Who is online

Users browsing this forum: No registered users and 0 guests