# [solved] tp_smapi doesn't load

## LoTeK

hi all, 

after following 

http://www.thinkwiki.org/wiki/Tp_smapi#Installation_in_Gentoo

to install tp_smapi, it fails to load with the error message:

```
M2-01 openbox # modprobe tp_smapi

FATAL: Error inserting tp_smapi (/lib/modules/3.5.7-gentoo/extra/tp_smapi.ko): No such device

```

output of:

```

M2-01 openbox # file /lib/modules/3.5.7-gentoo/extra/tp_smapi.ko

```

is:

```

/lib/modules/3.5.7-gentoo/extra/tp_smapi.ko: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), BuildID[sha1]=0x8c5964054c53ad23611346b552a09fe6ec614007, not stripped
```

because 

```
echo "tp_smapi" >> /etc/modules.autoload.d/kernel-2.6
```

doesn't exists anymore I've googled that one should use:

```
echo "tp_smapi" >> /etc/conf.d/modules 
```

what I did...

output of /usr/src/linux/.config:

http://bpaste.net/show/58509/

output of dmesg:

http://bpaste.net/show/58510/Last edited by LoTeK on Sat Nov 17, 2012 9:01 pm; edited 3 times in total

----------

## Abraxas

Did you rebuild tp_smapi?

----------

## LoTeK

with "emerge --oneshot tp_smapi" ?! yes I did.. but still the same error message...

----------

## cach0rr0

what model Thinkpad? 

got an lspci (or lspci -vnn) we can look at?

EDIT: dmesg says T420s

I don't know how old this Arch wiki entry is, but

https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_T420#Tp_smapi

Have you already unmasked tp_smapi-0.41? What version are you running?

----------

## LoTeK

It's a T420s..

output of lspci -vnn:

http://bpaste.net/show/58587/

I'm running version 0.40-r1.. When I "emerge --search tp_smapi" portage says that 0.40-r1 is the latest version available...

The arch wiki talks about 0.41 so it shouldn't be that old?! Should I'll try to install the "tpacpi-bat" script from AUR? (download tarball and then..?!   :Embarassed:  )

----------

## cach0rr0

 *LoTeK wrote:*   

> It's a T420s..
> 
> output of lspci -vnn:
> 
> http://bpaste.net/show/58587/
> ...

 

no need to go through AUR

0.41 is available in portage, but it is ~arch

```

* app-laptop/tp_smapi

     Available versions:  0.40-r1^u (~)0.40-r3^u (~)0.41^u {{hdaps KERNEL="linux"}}

     Homepage:            https://github.com/evgeni/tp_smapi/ http://tpctl.sourceforge.net/

     Description:         IBM ThinkPad SMAPI BIOS driver

```

so, I'd go this route:

```

mkdir -p /etc/portage/package.keywords

```

then if your arch is x86

```

echo 'app-laptop/tp_smapi ~x86' >> /etc/portage/package.keywords/thinkpad

```

or, if 64bit/amd64

```

echo 'app-laptop/tp_smapi ~amd64' >> /etc/portage/package.keywords/thinkpad

```

then try to emerge again; it should let you install 0.41

----------

## LoTeK

ok, I did what you suggested and it loads now... thanks very much!!!

what does ~arch means? archived? what is the reason for ~arch? (I didn't read the whole portage documents... so if it's explained there, I will read it more precisely    :Smile:  )

and just to be sure, tp_smapi allow one to control things like charging the battery to a certain percentage, but it does not reduce power consumption?Last edited by LoTeK on Sun Nov 18, 2012 1:17 am; edited 1 time in total

----------

## cach0rr0

 *LoTeK wrote:*   

> 
> 
> what does ~arch means? archived? what is the reason for ~arch? (I didn't read the whole portage documents... so if it's explained there, I will it more precisely    )
> 
> 

 

start here - http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1#doc_chap5

down under 'masked packages'

whenever an ebuild writer crafts an ebuild (the install files gentoo - specifically, portage - uses to do the compiling/install/etc), they will in essence "tag" that ebuild according to what architectures it's been tested against, and is known to run stable on. 

the ebuilds your install will accept to be used are based, among other things, on how the ebuild has been tagged by the developer - in this case, based on what keywords you have configured portage to accept. 

if my architecture is 'amd64', then by default, running "stable" gentoo, I will accept ebuilds that are tagged as 'amd64'

if I decide that I'm willing to use software from the testing branch, I can accept additional keywords. In the case of this ebuild, we have said that we will accept both 'amd64' and '~amd64', the latter being what ebuilds in the testing branch are tagged as. 

I can either do that globally, or i can do that on a per-package basis. 

Enabling an additional keyword on a per-package basis is what we have done with this package

Enabling an additional keyword globally entails adding ACCEPT_KEYWORDS="~amd64" to /etc/portage/make.conf (or /etc/make.conf, depending on which you use)

as to which is the best for you, there is no "one size fits all" rule. 

Expect a handful of quirks if you enable ~amd64 (or, ~x86) globally. 

Expect a colossal pain in the ass if you try to have half of your packages ~amd64, and half of them amd64 - unless you're really comfortable with portage

Expect things to be quiet if you run exclusively amd64

Expect things to be mostly quiet if you only very selectively unkeyword packages (as we've done here)

That is all a greatly simplified version of things. But it gets the basic point expressed. 

 *LoTeK wrote:*   

> 
> 
> and just to be sure, tp_smapi allow one to control things like charging the battery to a certain percentage, but it does not reduce power consumption?

 

I have absolutely zero idea. I haven't owned a thinkpad for a long while, and never used this module - i just googled a bit and found out the T420 requires a later version of tp_smapi  :Smile: 

----------

## LoTeK

ok, thanks for the detailed reply...

 *Quote:*   

> i just googled a bit and found out the T420 requires a later version of tp_smapi 

 

haha.. and some features aren't supported, but at least I can enable that the battery won't get fully charged.

----------

