LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   how to enable battery level monitor in slack12? (https://www.linuxquestions.org/questions/slackware-14/how-to-enable-battery-level-monitor-in-slack12-574580/)

tommcd 08-03-2007 05:30 PM

how to enable battery level monitor in slack12?
 
Using zenwalk got me interested in slackware, so I am trying to learn slackware. I installed slack12 on a laptop. I can't find a way to enable a battery monitor in xfce or kde. After doing some googling it seems you need a kernel with acpi support. I am using the 2.6.21.5-huge-smp kernel (uname -r shows 2.6.21.5-smp). I tried gkrellm, but it does not start a battery monitor. Do I need to install or compile a new kernel for battery monitor support? Or can I just modprobe something to get it to work?

Also, what is the best way to update slackware? Where are the mirrors for updates?
Any advice appreciated, thanks!

thegoofeedude 08-03-2007 05:34 PM

I second the question! In KDE, there is this message:
Quote:

Your computer seems to have a partial ACPI installation. ACPI was probably enabled, but some of the sub-options were not - you need to enable at least 'AC Adaptor' and 'Control Method Battery' and then rebuild your kernel.
Do we really have to recompile the kernel to get ACPI going?

XavierP 08-03-2007 05:57 PM

Your best bet is to grab the latest kernel and the current .config file and compile it how you want it. http://alien.slackbook.org/dokuwiki/...kernelbuilding is a great resource for how to do it.

tommcd 08-03-2007 06:13 PM

Thanks Xavier. Is that the only way to get laptop battery support? Don't any of the slack12 kernels have this?
Also, if I do compile a new kernel, what do I select to get acpi support? Can you make suggestions for a kernel for a laptop?
Also, an unrelated question: how do you go about updating slackware and choosing a mirror?

2Gnu 08-03-2007 06:24 PM

For what it's worth, with the 2.6.21.5 huge, I simply "modprobe battery" and use the XFCE4 battery monitor taskbar plugin.

edit: I just fired up gkrellm and the battery state & level shows there as well. modprobe the battery module and you should be all set.

gbonvehi 08-03-2007 06:28 PM

The ACPI stuff comes compiled as modules on default huge Slackware kernel, you've to load the modules with: /sbin/modprobe ac && /sbin/modprobe battery
To make them load on boot, add those lines to /etc/rc.d/rc.local

Edit: 2Gnu won heh. By the way, if you can make some spare time, I'd recommend you to try compiling your own kernel, it's a good learning experience (you'll probably curse a lot during the process heh).

tommcd 08-03-2007 06:29 PM

Quote:

Originally Posted by 2Gnu
For what it's worth, with the 2.6.21.5 huge, I simply "modprobe battery" and use the XFCE4 battery monitor taskbar plugin.

I tried doing that. The command returns without errors, but when I right-click on the panel and select "add new item" the bsttery monitor is not listed.

Pratt 08-03-2007 06:32 PM

I had to download the plugin from the official website

http://goodies.xfce.org/projects/pan...battery-plugin

dennisk 08-03-2007 06:34 PM

No, you don't have to recompile to get the battery monitor, but you do need to create an initrd with these ACPI modules:

Quote:

ac, acpi, battery, button, dock, fan, processor, thermal, video
and if you're booting the generic kernel ext3, as well assuming that your file system. It's all detailed in the READMEs and isn't that hard to do. Use the LILO utility found in KDE if you prefer to stay away from the command line when editing lilo.conf.

Dennisk

tommcd 08-03-2007 07:20 PM

Thanks for the suggestions. I installed the battery monitor for xfce (version 0.5, since it was newest) but it doesn't seem to be working. It just shows 50% when it should be full.
Dennisk, I can modprobe battery and modprobe ac, but when I try to modprobe acpi I get:

bash-3.1# modprobe acpi
FATAL: Error inserting acpi_cpufreq (/lib/modules/2.6.21.5-smp/kernel/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.ko): No such device

I am on 2.6.21.5-smp (huge smp kernel). Does this my kerel doesn't have acpi? If I look in /lib/modules/2.6.21.5-smp/kernel/cpu/cpufreq/ I do have acpi-cpufreq.ko listed there. Can I enable it?

tommcd 08-03-2007 09:14 PM

Got it working now! I rebooted, did "modprobe battery" checked all the check boxes in properties dialog of xfce battery monitor and now it works! Thanks guys.
I still don't know why "modprobe acpi" returns with errors, but at least the battery monitor works.

samwise17 08-03-2007 09:24 PM

I modprobed battery, ac, thermal etc in /etc/rc.d/rc.modules and the kde battery monitor is working.
However I dont think i needed to modprobe acpi.
I quote from the comments in rc.modules:
Quote:

#If a kernel supports ACPI it will always be built in, not a module.
You also might want to look at starting /proc/sys/vm/laptop-mode in /etc/rc.d/rc.local. Theres a post about that somewhere here.

As for updating, look at the slapt-get project. Or just do it manually using pkgtools.

If your learning slackware, I recommend reading the slackbook-2.0. I cant remember where I downloaded it from but you should be able to google it. It has some out-of-date stuff but is good for the basics.

Nikosis 08-04-2007 11:59 AM

Hi

modprobe ac
modprobe battery
modprobe processor
modprobe thermal

Now you should have in your Power Contron -> Laptop battery -> ACPI Config
Enable CPU throttling

thegoofeedude 08-04-2007 12:56 PM

Thank you guys for the tips! I thought it might be some modules, but I didn't know their names. I'm so glad I don't have to recompile a new kernel :-)

Sweet.

BCarey 08-04-2007 01:56 PM

Quote:

Originally Posted by thegoofeedude
I thought it might be some modules, but I didn't know their names.

You could find this out with the command "modprobe -l | grep acpi". "modprobe -l" lists all of the available modules. You might be interested in fan and button as well.

Brian


All times are GMT -5. The time now is 03:28 AM.