ckb-next-dev-detect: adapt for CMake

This commit is contained in:
Oleksii Vilchanskyi
2018-03-17 18:00:15 +02:00
committed by Tasos Sahanidis
parent 7519640980
commit 5c13c18c75
+11 -9
View File
@@ -10,7 +10,7 @@ read -p "Please make sure they are plugged in and press Enter.${N}"
export LC_ALL=C
#Check if user can write to the PWD
touch ckb-dev-detect-report.gz
touch ckb-next-dev-detect-report.gz
TOUCHRET=$?
if [ $TOUCHRET -ne 0 ]; then
echo "Could not write the report to disk, make sure this user can write to ${PWD}/"
@@ -18,7 +18,7 @@ if [ $TOUCHRET -ne 0 ]; then
exit
fi
OUT="ckb-dev-detect - $(date)"
OUT="ckb-next-dev-detect - $(date)"
# Applies to both
OUT="${OUT}${N}${N}Kernel: `uname -a`"
@@ -26,26 +26,28 @@ OUT="${OUT}${N}${N}Kernel: `uname -a`"
if [[ "$OSTYPE" == "darwin"* ]]; then
OUT="${OUT}${N}${N}OS Version:${N}`sw_vers`"
OUT="${OUT}${N}${N}USB Devices:${N}`system_profiler SPUSBDataType -detailLevel mini | grep -i -B3 -A9 1b1c`"
OUT="${OUT}${N}${N}Daemon log:${N}`cat /var/log/ckb-next-daemon.log`"
OUT="${OUT}${N}${N}GUI log:${N}`cat /tmp/ckb-next.log`"
else
OUT="${OUT}${N}${N}OS Version:${N}`lsb_release -a 2>/dev/null`"
OUT="${OUT}${N}${N}USB Devices:${N}`lsusb -vd '1b1c:' 2>&1`"
# Check if kernel ring buffer is reachable through systemd journal, fall back to dmesg
if [ -z "$(journalctl -k 2>/dev/null)" ]; then
OUT="${OUT}${N}${N}Systemctl error, falling back to dmesg:${N}`dmesg | grep -i \"ckb\|corsair\|1b1c\"`"
OUT="${OUT}${N}${N}Systemctl error, falling back to dmesg:${N}`dmesg | grep -i \"ckb-next\|corsair\|1b1c\"`"
else
# Pipe stderr to /dev/null, as grep would filter errors out anyway
OUT="${OUT}${N}${N}Dmesg on current boot:${N}`journalctl -o short-precise -k -b 0 2>/dev/null | grep -i \"ckb\|corsair\|1b1c\"`"
OUT="${OUT}${N}${N}Dmesg on last boot:${N}`journalctl -o short-precise -k -b -1 2>/dev/null | grep -i \"ckb\|corsair\|1b1c\"`"
OUT="${OUT}${N}${N}Daemon on current boot:${N}`journalctl -o short-precise -b 0 --unit=ckb-daemon 2>&1`"
OUT="${OUT}${N}${N}Daemon on last boot:${N}`journalctl -o short-precise -b -1 --unit=ckb-daemon 2>&1`"
OUT="${OUT}${N}${N}Dmesg on current boot:${N}`journalctl -o short-precise -k -b 0 2>/dev/null | grep -i \"ckb-next\|corsair\|1b1c\"`"
OUT="${OUT}${N}${N}Dmesg on last boot:${N}`journalctl -o short-precise -k -b -1 2>/dev/null | grep -i \"ckb-next\|corsair\|1b1c\"`"
OUT="${OUT}${N}${N}Daemon on current boot:${N}`journalctl -o short-precise -b 0 --unit=ckb-next-daemon 2>&1`"
OUT="${OUT}${N}${N}Daemon on last boot:${N}`journalctl -o short-precise -b -1 --unit=ckb-next-daemon 2>&1`"
fi
OUT="${OUT}${N}${N}Dev nodes:${N}`find /dev/input/ckb* -print -type f -exec cat {} \; 2>&1`"
OUT="${OUT}${N}${N}Environment:${N}`printenv | grep "QT\|XDG.*DESKTOP" 2>&1`"
fi
# Gzip and write output
echo "$OUT" | gzip > ckb-dev-detect-report.gz
echo "$OUT" | gzip > ckb-next-dev-detect-report.gz
echo "Done! Please send the following report to the developers."
echo "Location: ${PWD}/ckb-dev-detect-report.gz"
echo "Location: ${PWD}/ckb-next-dev-detect-report.gz"