Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
[tools] script to create power issues report
  • Loading branch information
Denis Zalevskiy committed Dec 22, 2014
1 parent d67e5b3 commit 8f54a14
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions tools/power-diagnostics.sh
@@ -0,0 +1,53 @@
#!/bin/bash

if $(who) != "root"; then
echo "Please execute this script as root" 1>&2
exit 1
fi

function sep
{
echo
echo "@${@}@"
}

sep rpm
rpm -qa

sep rpm-upower
rpm -ql upower

sep rpm-statefs
rpm -ql statefs-provider-upower

sep files
ls -al /usr/libexec/upowerd
find /usr/lib/statefs/ -type f -exec ls -al {} \;

sep provider-info
find /var/lib/statefs -name '*power*' -print -exec cat {} \;

sep ps
ps aux

sep sysfs
find /sys/class/power_supply/ -follow -maxdepth 2 -name uevent -print -exec cat {} \;

sep upower
upower -d

function dump_file
{
for f in $@; do
ls -al $f
cat $f
echo
done
}

export -f dump_file

sep statefs
find /run/state/namespaces/Battery -follow -type f | xargs bash -c 'dump_file "$@"'


0 comments on commit 8f54a14

Please sign in to comment.