Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # NAME: custom-thunderbolt
- # PATH: /lib/systemd/system-sleep
- # CALL: Called from SystemD automatically
- # DATE: Oct 28 2018.
- # NOTE: From comment #61 at: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/522998
- # Original script was for xhci_hcd
- TMPLIST=/tmp/thunderbolt-dev-list
- case $1/$2 in
- pre/*)
- echo "$0: Going to $2..."
- echo -n '' > $TMPLIST
- for i in `ls /sys/bus/pci/drivers/thunderbolt/ | egrep '[0-9a-z]+\:[0-9a-z]+\:.*$'`; do
- # Unbind xhci_hcd for first device XXXX:XX:XX.X:
- echo -n "$i" | tee /sys/bus/pci/drivers/thunderbolt/unbind
- echo "$i" >> $TMPLIST
- done
- ;;
- post/*)
- echo "$0: Waking up from $2..."
- for i in `cat $TMPLIST`; do
- # Bind xhci_hcd for first device XXXX:XX:XX.X:
- echo -n "$i" | tee /sys/bus/pci/drivers/thunderbolt/bind
- done
- rm $TMPLIST
- ;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement