#!/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" |
The same is true on Nexus 7 which uses /sys/class/leds/lcd-backlight
(hmm, pattern!)
NOTE: This script is designed for Laptops. I'll prepare a second version later once I work on some extra tooling and have more questions to ask about the mobile world with Android kernel.
"(nothing sensitive or personally-identifiable though)"
http://www.zygoon.pl/2015/03/crowdsourcing-help-needed-share-your.html
Somebody might regard the uname -a reported hostname (which by default on most systems includes a username) as sensible.
This could do it:
uname -a |sed s/uname -n
/fake-host/g
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.
This doesn't seem to work on the BQ phone. All the interesting values there are in
/sys/class/leds/lcd-backlight
. Awww, android, how I hate thee!