Skip to content

Instantly share code, notes, and snippets.

@AaronDewes
Last active April 9, 2021 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AaronDewes/349b393421b8c723e75e575ba856cb51 to your computer and use it in GitHub Desktop.
Save AaronDewes/349b393421b8c723e75e575ba856cb51 to your computer and use it in GitHub Desktop.
Umbrel Information gathering script
#!/usr/bin/env bash
if [[ $UID != 0 ]]; then
echo "This script needs to be run as root"
exit 1
fi
# Helper functions
get_uas_string () {
UDEVADM_DATA=$(sudo -u umbrel udevadm test /block/${block_device} 2> /dev/null)
ID_VENDOR=$(echo "${UDEVADM_DATA}" | grep "ID_VENDOR_ID" | sed 's/ID_VENDOR_ID=//')
ID_MODEL=$(echo "${UDEVADM_DATA}" | grep "ID_MODEL_ID" | sed 's/ID_MODEL_ID=//')
echo "${ID_VENDOR}:${ID_MODEL}:u"
}
upload() {
curl \
--header "Content-Type: text/plain" \
--request POST \
--silent \
--data-binary @- \
https://umbrel-paste.vercel.app/documents \
| awk -F '"' '{print "https://umbrel-paste.vercel.app/"$6}'
}
# The actual script
echo "Gathering information..."
OUTPUT=""
OUTPUT+="$(sudo lspci -d 1106:3483 -xxx | awk '/^50:/ { print "VL805 FW version: " $5 $4 $3 $2 }')\n"
OUTPUT+="UAS string: $(get_uas_string)\n"
sleep 1
# Disable UAS
echo "Reducing SSD power consumption"
sed "s/usb-storage.quirks=/usb-storage.quirks=$(get_uas_string),/g" -i /boot/cmdline.txt
sleep 1
# Disable audio & bluetooth
echo "Disabling Audio & Bluetooth on the Pi"
curl https://github.com/getumbrel/umbrel-os/blob/ab1fe4a65bf59021dd9a094b10d37f3f87dd386b/stage1/00-boot-files/files/config.txt> /boot/config.txt
echo "dtoverlay=disable-bt" >> /boot/config.txt
sleep 2
echo "Thank you for participating in this Umbrel experiment!"
echo "We hope that this can fix your issues with Umbrel, and help us diagnose this kind of issues better in the future."
echo "Please copy the following link and send it to a member of the Umbrel team:"
echo "${OUTPUT} === Umbrel-Paste split === $(dmesg)" | upload
echo "Your node will now reboot. Please check if you still have this issue after that reboot."
echo "Also, please follow t.me/getumbrel/50080 after the reboot to gather more information."
echo "Thanks!"
sleep 5
sudo reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment