diff options
author | Sven Wegener <sven.wegener@stealer.net> | 2021-07-04 13:19:43 +0200 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2021-08-13 13:38:07 -0500 |
commit | 63955056ecb98faa1a02d90d5a4742515f0299c8 (patch) | |
tree | a43e1bbf1aac208afbe473eab2e44a3e43a8f633 /init.d/fsck.in | |
parent | 1e975be89670f53db47aeef3dbb3361166517c26 (diff) |
on_ac_power: support multiple power_supply devices in sysfs
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.
Diffstat (limited to 'init.d/fsck.in')
0 files changed, 0 insertions, 0 deletions