LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Using modprobe.d to insert acpi modules (https://www.linuxquestions.org/questions/debian-26/using-modprobe-d-to-insert-acpi-modules-539809/)

rickh 03-22-2007 09:31 PM

Using modprobe.d to insert acpi modules
 
Not sure whether this question should be in another forum, but after some intensive googling I found hints that it's a Debian specific problem. Apart from that I won't go into the details of troubleshooting, but now that I've identified the problem I need a little help solving it.

Recently the battery indicator on the Gnome panel just quit working. The little icon is there but doing nothing. I think it happened when I upgraded to kernel 2.6.18-4.

It turns out that some of the acpi modules are not being loaded.
Code:

debian-lt:~# ls /lib/modules/2.6.18-4-686/kernel/drivers/acpi/
ac.ko        button.ko    fan.ko    ibm_acpi.ko  thermal.ko
asus_acpi.ko  container.ko  hotkey.ko  processor.ko  toshiba_acpi.ko
battery.ko    dock.ko      i2c_ec.ko  sbs.ko        video.ko

The only ones that show up on lsmod after a boot are: fan, processor, and thermal. I found out that in order for the battery indicator to work, I also needed ac and battery. Another (quite old) reference said I should also have button even tho I have no idea what it does. So I used modprobe to insert those three, and now things work. So far, so good.

The remaining problem is that when I reboot, I have to go thru it again. How do I get those modules inserted automatically during boot? I tried module-update, but that didn't work.

I don't know how fan, processor, and thermal got inserted. They must be compiled into the kernel. The only acpi module I can find reference to in /etc/modprobe.d is ibm_acpi.ko, although that does not show up in lsmod. I also don't understand the file:
Code:

debian-lt:~# cat /etc/modprobe.d/ibm_acpi.modprobe
options ibm_acpi hotkey=enable,0xff9f experimental=1

Finally what are container.ko, hotkey.ko, dock.ko, i2c_ec.ko, sbs.ko, video.ko, (as well as button.ko) intended for? Should I also be inserting them?

cgjones 03-22-2007 10:22 PM

Not sure if this will help or not, but you might want to check out /etc/init.d/acpid and /etc/default/acpid. On my testing system, these two files look like they handle loading the ACPI modules during boot.

JimBass 03-23-2007 07:24 AM

Rickh,

/etc/default/acpid is the place to load the acpi modules you want, although it should also be able to be done within /etc/modprobe.d/. Here is the list from my /etc/default/acpid, and I have a functional battery monitor, also on a thinkpad:

Code:

MODULES="battery ac processor button fan thermal"
I also have this for /etc/modprobe.d/ibm_acpi.thinkpad:
Code:

options ibm_acpi hotkey=enable,0xff9f experimental=1
I believe using apt-get to install the thinkpad hotkey functions added that, it simply maps some of the special function keys to things, most likely the power and volume buttons.

Peace,
JimBass

nx5000 03-23-2007 07:33 AM

Also check that /etc/init.d/acpid contains this line
Quote:

MODPROBE_OPTIONS="$MODPROBE_OPTIONS -q"
and not this one:
Quote:

MODPROBE_OPTIONS="$MODPROBE_OPTIONS -Q"
This was broken for me there is a bug in the bts. Putting it back to -q solved the problem of gnome applets, cpufreq,..

button: This is used for switching off your PC by pressing the OFF button directly. Very practical, no need to type halt,..
video: I think this is for energy saving, it stops your monitor after some time.

fan,button,thermal,.. were not loaded due to the bug I mentionned. Maybe it didn't get in etch.. then ignore.


Quote:

How do I get those modules inserted automatically during boot?
The critical thing ( fan + thermal) are (should.. they are on mine) loaded during Initrd in case the initrd goes in an endless loop and you are not in front of the box.

/usr/share/initramfs-tools/scripts/init-premount/

The rest is loaded by what JimBass said

rickh 03-23-2007 09:56 AM

Thanks a lot, to all of you. Just when you think you're getting pretty good at this stuff, it's amazing how easy it is to encounter something that will confuse and humble you.

nx5000 03-23-2007 10:27 AM

True but.. well, we are talking of a complete OS here, not a small app!

Actually I am also looking for a long time at a link, doc, anything that describes the steps of the booting process.

rickh 03-24-2007 11:23 AM

OK, It took me a couple days to get back to this.

@ nx5000:
Quote:

Also check that /etc/init.d/acpid contains this line
"MODPROBE_OPTIONS="$MODPROBE_OPTIONS -q"
and not this one:
"MODPROBE_OPTIONS="$MODPROBE_OPTIONS -Q"
That seems to have been my immediate problem. I noticed that in the same file on my desktop machine, it also had the upper case "Q" ... so I changed that one, too. Of course on that machine the battery incator does not exist, so nothing visible has changed. Was that a good idea?

Also, I notice that while the battery indicator states the percentage of charge remaining, it no longer gives an estimate of the time. Changing the properties of the panel icon does not affect that. This is a very minor issue, just makes me curious.

nx5000 03-24-2007 11:34 AM

Well it was a bug so you should correct everywhere otherwise acpi might not work.
I'm surprised that this got into etch!
As this file is a configuration file, it doesn't get updated even during upgrades (i currently have package acpid version 1.0.4-7)

For the battery, no clue really. The only thing that you can check is that the information exported by the kernel is correct. Then it's up to the application to calculate it.

Code:

cat /proc/acpi/battery/C*/info
present:                no          <-- Battery slot 1
present:                yes                <-- Battery slot 2
design capacity:        4310 mAh
last full capacity:      4310 mAh
battery technology:      rechargeable
design voltage:          14800 mV
design capacity warning: 431 mAh
design capacity low:    44 mAh
capacity granularity 1:  100 mAh
capacity granularity 2:  100 mAh
model number:            Primary
serial number:          00001 2006/11/20
battery type:            LIon
OEM info:                Hewlett-Packard


cat /proc/acpi/battery/C*/state
present:                no
present:                yes
capacity state:          ok
charging state:          charged
present rate:            0 mA
remaining capacity:      4208 mAh
 
present voltage:        16602 mV

That's my remote machine which is plugged..
There's no command for unplugging the cord so I can't check :)

rickh 03-24-2007 11:38 AM

Quote:

Well it was a bug so you should correct everywhere otherwise acpi might not work. I'm surprised that this got into etch!
I doubt that it did. Since the freeze, I've been doing my regular dist-upgrades from Sid.

nx5000 03-24-2007 11:42 AM

Ah ok I thought you were using etch.
I need to upgrade my eyes :)


All times are GMT -5. The time now is 09:18 PM.