Advertisement
Guest User

Untitled

a guest
Sep 26th, 2019
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # NAME: custom-thunderbolt
  4. # PATH: /lib/systemd/system-sleep
  5. # CALL: Called from SystemD automatically
  6.  
  7. # DATE: Oct 28 2018.
  8.  
  9. # NOTE: From comment #61 at: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/522998
  10.  
  11. # Original script was for xhci_hcd
  12.  
  13. TMPLIST=/tmp/thunderbolt-dev-list
  14.  
  15. case $1/$2 in
  16. pre/*)
  17. echo "$0: Going to $2..."
  18. echo -n '' > $TMPLIST
  19. for i in `ls /sys/bus/pci/drivers/thunderbolt/ | egrep '[0-9a-z]+\:[0-9a-z]+\:.*$'`; do
  20. # Unbind xhci_hcd for first device XXXX:XX:XX.X:
  21. echo -n "$i" | tee /sys/bus/pci/drivers/thunderbolt/unbind
  22. echo "$i" >> $TMPLIST
  23. done
  24. ;;
  25. post/*)
  26. echo "$0: Waking up from $2..."
  27. for i in `cat $TMPLIST`; do
  28. # Bind xhci_hcd for first device XXXX:XX:XX.X:
  29. echo -n "$i" | tee /sys/bus/pci/drivers/thunderbolt/bind
  30. done
  31. rm $TMPLIST
  32. ;;
  33. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement