从命令行显示`/proc/acpi/battery/BAT0/info`

从命令行显示`/proc/acpi/battery/BAT0/info`

在 MacBookPro10,1 上全新安装的 Debian/stable 9.5 上,我尝试从命令行显示 acpi 信息。

这是我所看到的:

$ 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

acpi似乎还是看到了电池:

$ 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

为了从界面获取正确的电池信息,我在安装中缺少什么/proc/acpi

答案1

acpi查看我的 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
...

所以它似乎正在从 读取信息/sys/class/power_supply/*

由于该功能是在/sys/class/power_supply/*Debian 内核中提供的,并且在构建时没有CONFIG_ACPI_PROCFS_POWER

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

您将不会再看到任何内容/proc/acpi/battery/*

相关内容