0

On a fresh Debian/stable 9.5 installation on a MacBookPro10,1, I am trying to display acpi info from the command line.

Here is what I see:

$ find /proc/acpi/
/proc/acpi/
/proc/acpi/button
/proc/acpi/button/lid
/proc/acpi/button/lid/LID0
/proc/acpi/button/lid/LID0/state
/proc/acpi/wakeup

But acpi seems to see the battery anyway:

$ acpi -V
Battery 0: Discharging, 46%, 01:17:56 remaining
Battery 0: design capacity 8460 mAh, last full capacity 7415 mAh = 87%
Adapter 0: off-line
Cooling 0: Processor 0 of 17
Cooling 1: Processor 0 of 17
Cooling 2: Processor 0 of 17
Cooling 3: BAT0 no state information available
Cooling 4: Processor 0 of 17
Cooling 5: intel_powerclamp no state information available
Cooling 6: Processor 0 of 17
Cooling 7: Processor 0 of 17
Cooling 8: Processor 0 of 17
Cooling 9: x86_pkg_temp no state information available
Cooling 10: Processor 0 of 17

What am I missing from the installation to get proper battery info from /proc/acpi interface ?

2

Looking through the system calls executed by acpi on my Ubuntu:

~ strace -e open,chdir acpi
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
chdir("/sys/class")                     = 0
chdir("power_supply")                   = 0
open(".", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
open("BAT0/current_now", O_RDONLY)      = -1 ENOENT (No such file or directory)
open("BAT0/power_now", O_RDONLY)        = 4
open("BAT0/charge_now", O_RDONLY)       = -1 ENOENT (No such file or directory)
open("BAT0/energy_now", O_RDONLY)       = 4
open("BAT0/voltage_now", O_RDONLY)      = 4
...

So it seems to be reading information from /sys/class/power_supply/*.

Since the functionality is provided in /sys/class/power_supply/* and since Debian kernel is build without CONFIG_ACPI_PROCFS_POWER:

$ grep CONFIG_ACPI_PROCFS_POWER /boot/config-$(uname -r)
# CONFIG_ACPI_PROCFS_POWER is not set

You will not see anything anymore in /proc/acpi/battery/*

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.