-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_hooks.sh
More file actions
executable file
·31 lines (28 loc) · 912 Bytes
/
install_hooks.sh
File metadata and controls
executable file
·31 lines (28 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
if test -e /etc/libvirt/ && ! test -e /etc/libvirt/hooks;
then
mkdir -p /etc/libvirt/hooks;
fi
if test -e /etc/libvirt/hooks/qemu;
then
mv /etc/libvirt/hooks/qemu /etc/libvirt/hooks/qemu_last_backup
fi
if test -e /usr/local/bin/vfio-startup;
then
mv /usr/local/bin/vfio-startup /usr/local/bin/vfio-startup.bkp
fi
if test -e /usr/local/bin/vfio-teardown;
then
mv /usr/local/bin/vfio-teardown /usr/local/bin/vfio-teardown.bkp
fi
if test -e /etc/systemd/system/libvirt-nosleep@.service;
then
rm /etc/systemd/system/libvirt-nosleep@.service
fi
cp systemd-no-sleep/libvirt-nosleep@.service /etc/systemd/system/libvirt-nosleep@.service
cp hooks/vfio-startup /usr/local/bin/vfio-startup
cp hooks/vfio-teardown /usr/local/bin/vfio-teardown
cp hooks/qemu /etc/libvirt/hooks/qemu
chmod +x /usr/local/bin/vfio-startup
chmod +x /usr/local/bin/vfio-teardown
chmod +x /etc/libvirt/hooks/qemu