| #!/bin/sh |
| |
| # Copyright 2017 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| # Prints raw power supply information from sysfs. This is the input that powerd |
| # uses, and can be useful for debugging low-level battery or charger issues. |
| |
| # Please don't use this script in tests. Just read the information that you need |
| # directly. |
| |
| for ps in /sys/class/power_supply/*; do |
| echo "${ps}" |
| for f in "${ps}"/*; do |
| base=$(basename "${f}") |
| if [ ! -f "${f}" ] || [ "${base}" = uevent ] \ |
| || [ "${base}" = serial_number ]; then |
| continue |
| fi |
| printf " %-20s %s\n" "${base}" "$(cat "${f}")" |
| done |
| done |