Last active
August 29, 2015 14:17
-
-
Save zyga/b8f64858aab37e44cf65 to your computer and use it in GitHub Desktop.
Basic backlight data collection script for Lantern
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
#!/bin/sh | |
# Basic backlight data collection script for Lantern | |
# Written by Zygmunt Krynicki <zygmunt.krynicki@canonical.com> | |
set -x | |
id=$(cat /proc/sys/kernel/random/uuid) | |
dest=$(mktemp -d --suffix=-lantern) | |
lspci > "$dest/lspci" | |
lsmod > "$dest/lsmod" | |
uname -a > "$dest/uname" | |
if [ -e /etc/os-release ]; then | |
cp /etc/os-release "$dest/" | |
fi | |
SCB=/sys/class/backlight | |
if [ -e $SCB ]; then | |
mkdir "$dest/backlight" | |
for device in $(ls $SCB); do | |
device_dest="$dest/backlight/$device" | |
mkdir "$device_dest" | |
cp "$SCB/$device/max_brightness" "$device_dest/" | |
cp "$SCB/$device/actual_brightness" "$device_dest/" | |
cp "$SCB/$device/brightness" "$device_dest/" | |
cp "$SCB/$device/type" "$device_dest/" | |
done | |
fi | |
tar -Jcf "lantern-submission-$id.tar.xz" -C "$dest" . | |
rm -rf "$dest" | |
echo -- "$id" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh, good point about the hostname! I didn't realize that.
I'll change how uname gets invoked so that we don't have this needless piece of info. I'm currently working on a much much better (though far more complex) version that can do some useful manual tests as well. I'll post it to the main tree at github.com/zyga/lantern.
In the meantime, you can open issues on the current version of the script there.