summaryrefslogtreecommitdiff
path: root/.local/share/libvirt-hooks/qemu.d/win11/prepare/begin
diff options
context:
space:
mode:
authorSeth Flynn <[email protected]>2021-11-24 02:02:25 -0500
committerseth <[email protected]>2022-08-04 04:40:17 -0400
commit944b6db89ae715d93d0804a6a2358dcab88f1c07 (patch)
tree5244d9f5ddf4f8a661e17c184fbadf2e553dbd43 /.local/share/libvirt-hooks/qemu.d/win11/prepare/begin
initial bare repo commit
Diffstat (limited to '.local/share/libvirt-hooks/qemu.d/win11/prepare/begin')
-rwxr-xr-x.local/share/libvirt-hooks/qemu.d/win11/prepare/begin/start.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/.local/share/libvirt-hooks/qemu.d/win11/prepare/begin/start.sh b/.local/share/libvirt-hooks/qemu.d/win11/prepare/begin/start.sh
new file mode 100755
index 0000000..10dc07a
--- /dev/null
+++ b/.local/share/libvirt-hooks/qemu.d/win11/prepare/begin/start.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# for debugging
+set -x
+
+# stop sddm
+systemctl stop sddm.service
+
+# unbind vt console
+echo 0 > /sys/class/vtconsole/vtcon0/bind
+echo 0 > /sys/class/vtconsole/vtcon1/bind
+
+# avoid race condition
+sleep 10
+
+# unload gpu modules
+modprobe -r amdgpu
+modprobe -r gpu_sched
+modprobe -r ttm
+modprobe -r drm_kms_helper
+modprobe -r drm_ttm_helper
+modprobe -r i2c_algo_bit
+modprobe -r drm
+
+# unbind gpu
+virsh nodedev-detach pci_0000_06_00_0
+virsh nodedev-detach pci_0000_06_00_1
+
+# load vfio modules
+modprobe vfio
+modprobe vfio-pci
+modprobe vfio_iommu_type1