If you have a machine with a non-boring power connection (USB, etc)
or an UPS that's recognized by the kernel (rather than just nut), please
ls /sys/class/power_supply/ -- if you see anything other than "ac" or
"battery" there, please send me that data.
grep . /sys/class/power_supply/*/* | mail -s power kilob...@angband.pl
(or send it manually if you have no configured local MTA)
I'm especially interested in sources that can themselves switch between
abundant and stored power, such as UPS. In that case, it'd be good to get
the data for both mains and battery cases.
==== request end, continue reading only if bored ====
Because of the recent thread of apt dropping Suggests:powermgmt-base in
favour of systemd's implementation, I looked into getting the former into
shape. Even in the current neglected shape, it already does a strictly
better job than .service ConditionACPower, but the differences are only for
legacy hardware (Apple Powerbooks -- PMU, ancient i386 -- APM). What I'm
about to upload adds support for USB (tablets and phones), but it'd be good
to research other sources known to the kernel.
The full list of possible data available through sysfs is:
"Unknown", "Battery", "UPS", "Mains", "USB",
"USB_DCP", "USB_CDP", "USB_ACA", "USB_C",
"USB_PD", "USB_PD_DRP", "BrickID"
As far as I managed to find out, none of USB* returns information about
where its power comes from, but I did not find any "intelligent" battery
connector that identifies this way. Thus, on tablets, "Battery" means
stored power while USB* means an attached charger. Yeah, it's possible
that the other end of the USB cable is a disconnected laptop or a power
bank, but in the vast majority of cases charging means abundant power
-- no different from a no-control or nut-only UPS being recognized "ac"
even if it's going from battery.
Alas, hardware I own includes none of such interesting cases: my only UPS
is nut-only, at the moment I have no control access to ones in data centers,
my ARM gear that can be powered via USB lacks the circuitry to tell this to
the kernel (even though the SoC has this functionality -- ie, I have "usb"
listed in sysfs but it always says it's off), etc.
⣾⠁⢠⠒⠀⣿⡁ A dumb species has no way to open a tuna can.
⢿⡄⠘⠷⠚⠋⠀ A smart species invents a can opener.
⠈⠳⣄⠀⠀⠀⠀ A master species delegates.
Dng mailing list