Guest User

vfio2

a guest
Jan 13th, 2022
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #!/bin/bash
  2. set -x
  3.  
  4. echo "Beginning of teardown!"
  5.  
  6. # Restart Display Manager
  7. input="/tmp/vfio-store-display-manager"
  8. while read displayManager; do
  9. if command -v systemctl; then
  10. systemctl start "$displayManager.service"
  11. else
  12. if command -v sv; then
  13. sv start $displayManager
  14. fi
  15. fi
  16. done < "$input"
  17.  
  18. # Rebind VT consoles (adapted from https://www.kernel.org/doc/Documentation/fb/fbcon.txt)
  19. input="/tmp/vfio-bound-consoles"
  20. while read consoleNumber; do
  21. if test -x /sys/class/vtconsole/vtcon${consoleNumber}; then
  22. if [ `cat /sys/class/vtconsole/vtcon${consoleNumber}/name | grep -c "frame buffer"` \
  23. = 1 ]; then
  24. echo "Rebinding console ${consoleNumber}"
  25. echo 1 > /sys/class/vtconsole/vtcon${consoleNumber}/bind
  26. fi
  27. fi
  28. done < "$input"
  29.  
  30. # Rebind framebuffer for nvidia
  31. if test -e "/tmp/vfio-is-nvidia" ; then
  32. echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind
  33. fi
  34.  
  35. echo "End of teardown!"
Advertisement
Add Comment
Please, Sign In to add comment