This repository has been archived by the owner on Sep 4, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "$@"' | ||
|
||
|