site  contact  subhomenews

powerapplet-tray fixed for recent kernels

October 09, 2021 — BarryK

I received an email from R Melville, that the tray battery monitor isn't working in EasyOS 3.0, but is working with the Buster-series.

I looked at the source code, and found that it relies on a deprecated feature in the kernel, that has been removed in the kernel. Don't know what kernel version it happened, but CONFIG_ACPI_PROCFS_POWER is removed.

This configure option causes the appearance of /proc/acpi/battery, but that folder is no longer there. The battery status, on my laptop, is now at /sys/class/power_supply/BAT1

And just to make life more complicated, it seems that in earlier kernels it was /sys/class/power_supply/BAT0, but the kernel developers decided to rename it to BAT1. Don't know what kernel version that started either.

I have modified powerapplet-tray, and kept backwards compatibility, right back to /proc/apm. Still checks for /proc/acpi/battery. It now also checks for /sys/class/power_supply/BAT0, if that not exist then checks for BAT1.

The version is now 3.0, source here:

http://distro.ibiblio.org/easyos/source/alphabetical/p/

It has been compiled in OpenEmbedded, for x86_64 and aarch64. The x86_64 package is here:

http://distro.ibiblio.org/easyos/amd64/packages/compat/oe/dunfell/

...you can download and install it. Note, the executable hasn't been stripped.     

Tags: easy