mirror of
https://github.com/OpenRC/openrc.git
synced 2024-11-30 05:13:29 +08:00
67dfdec43f
Newer devices have multiple power_supply devices in sysfs: $ grep ^ /sys/class/power_supply/*/type /sys/class/power_supply/AC/type:Mains /sys/class/power_supply/BAT0/type:Battery /sys/class/power_supply/ucsi-source-psy-USBC000:001/type:USB /sys/class/power_supply/ucsi-source-psy-USBC000:002/type:USB There are two "USB" Type-C ports than can supply power and both are aggregated into the "Mains" power supply by the firmware. The "Battery" also counts as a power supply, but is missing the online attribute. The -f check with a wildcard pattern results in an error, when multiple devices are present: /lib/rc/bin/on_ac_power: line 21: [: too many arguments When the power_supply class is registered, check for a "Mains" device. Fixes #427. |
||
---|---|---|
.. | ||
.gitignore | ||
halt.in | ||
Makefile | ||
on_ac_power | ||
poweroff.in | ||
rc-sstat.in | ||
reboot.in | ||
shutdown.in |