Skip to content

Rename battery under /sys

grimmware requested to merge grimmware/reform-tools:rename_battery into staging

Changing this to BAT0 from 8xlifepo4 as this code is shared with the pocket reform which doesn't use 8 lifepo4 cells

Tested on Pocket Reform:

grimmware@fmlr/pts/1:~/src/reform-tools/lpc [rename_battery 13]
> ls  /sys/class/power_supply
8xlifepo4
grimmware@fmlr/pts/1:~/src/reform-tools/lpc [rename_battery 13]
> sudo rmmod reform2_lpc
[sudo] password for grimmware:
grimmware@fmlr/pts/1:~/src/reform-tools/lpc [rename_battery 13]
> ls  /sys/class/power_supply
grimmware@fmlr/pts/1:~/src/reform-tools/lpc [rename_battery 13]
> sudo insmod ./reform2_lpc.ko
grimmware@fmlr/pts/1:~/src/reform-tools/lpc [rename_battery 13]
> ls  /sys/class/power_supply
BAT0
grimmware@fmlr/pts/1:~/src/reform-tools/lpc [rename_battery 13]
> cat /sys/class/power_supply/BAT0/capacity
91

waybar appears to pick up the change automagically.

Merge request reports

Loading