- remove_vfio_module
-
- VFIO_PATH="kernel/drivers/vfio/pci/vfio-pci.ko"
-
- echo "Loading VFIO module"
- /sbin/lsmod | grep -s vfio_pci > /dev/null
- if [ $? -ne 0 ] ; then
- if [ -f /lib/modules/$(uname -r)/$VFIO_PATH ] ; then
- sudo /sbin/modprobe vfio-pci
- fi
- fi
-
- # make sure regular users can read /dev/vfio
- echo "chmod /dev/vfio"
- sudo chmod a+x /dev/vfio
- if [ $? -ne 0 ] ; then
- echo "FAIL"
- quit
- fi
- echo "OK"
-
- # check if /dev/vfio/vfio exists - that way we
- # know we either loaded the module, or it was
- # compiled into the kernel
- if [ ! -e /dev/vfio/vfio ] ; then
- echo "## ERROR: VFIO not found!"
- fi
+ remove_vfio_module
+
+
+ echo "Loading VFIO module"
+ /sbin/lsmod | grep -s vfio_pci > /dev/null
+ if [ $? -ne 0 ] ; then
+ sudo /sbin/modprobe -v vfio-pci
+ fi
+
+ # make sure regular users can read /dev/vfio
+ echo "chmod /dev/vfio"
+ sudo chmod a+x /dev/vfio
+ if [ $? -ne 0 ] ; then
+ echo "FAIL"
+ quit
+ fi
+ echo "OK"
+
+ # check if /dev/vfio/vfio exists - that way we
+ # know we either loaded the module, or it was
+ # compiled into the kernel
+ if [ ! -e /dev/vfio/vfio ] ; then
+ echo "## ERROR: VFIO not found!"
+ fi