Advertisement
Guest User

VFIO OVERRIDE

a guest
May 13th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. You will need to creat some files manualy.
  2. 1. Create vfio-pci-override.sh in /sbin with the following content:
  3.  
  4. #!/bin/sh
  5.  
  6. DEVS="0000:02:00.0 0000:02:00.1"
  7.  
  8. for DEV in $DEVS; do
  9.     echo "vfio-pci" > /sys/bus/pci/devices/$DEV/driver_override
  10. done
  11.  
  12. modprobe -i vfio-pci
  13.  
  14. 2. Create file vga_hook in /usr/share/initramfs-tools/hooks/ with the following content:
  15.  
  16. #!/bin/sh
  17. PREREQ=""
  18. prereqs()
  19. {
  20.      echo "$PREREQ"
  21. }
  22.  
  23. case $1 in
  24. prereqs)
  25.      prereqs
  26.      exit 0
  27.      ;;
  28. esac
  29. . /usr/share/initramfs-tools/hook-functions
  30. copy_exec /sbin/vfio-pci-override.sh /sbin
  31.  
  32. 3. Make both files executable:
  33.  
  34. $ sudo chmod +x /sbin/vfio-pci-override.sh
  35. $ sudo chmod +x /usr/share/initramfs-tools/hooks/vga_hook
  36.  
  37. 4. Add the following in modprobe.d/local.conf in place of the "options vfio-pci ids=xxx" line if present and remove the boot options from grub cmd line "vfio-pci.ids=10de:13c0,10de:0fbb".
  38.  
  39. install vfio-pci /sbin/vfio-pci-override-vga.sh
  40.  
  41. 5. Rebuild your initramfs:
  42.  
  43. $ sudo update-initramfs -u
  44.  
  45. 6. Reboot and proffit.
  46.  
  47. P.S. The line DEVS in vfio-pci-override.sh is for your current setup from the lspci -vnk you posted before. You can check for success of the update-initramfs by:
  48.  
  49. $ sudo lsinitramfs -l /boot/initrd.img-xxx |grep vfio-pci-override-vga.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement