From e70f12845e51d854dbb47fe9cf76acbec6eb9d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Vad=C3=A1sz?= Date: Fri, 7 Jul 2023 12:51:25 +0000 Subject: [PATCH] No longer touch system directories where not needed. --- hooks/qemu | 4 ++-- hooks/{vfio-startup.sh => vfio-startup} | 0 hooks/{vfio-teardown.sh => vfio-teardown} | 0 install_hooks.sh | 16 ++++++++-------- 4 files changed, 10 insertions(+), 10 deletions(-) rename hooks/{vfio-startup.sh => vfio-startup} (100%) rename hooks/{vfio-teardown.sh => vfio-teardown} (100%) diff --git a/hooks/qemu b/hooks/qemu index c68007c..64d3b9d 100755 --- a/hooks/qemu +++ b/hooks/qemu @@ -7,12 +7,12 @@ if [[ $OBJECT == "win10" ]]; then case "$OPERATION" in "prepare") systemctl start libvirt-nosleep@"$OBJECT" 2>&1 | tee -a /var/log/libvirt/custom_hooks.log - /bin/vfio-startup.sh 2>&1 | tee -a /var/log/libvirt/custom_hooks.log + /usr/local/bin/vfio-startup 2>&1 | tee -a /var/log/libvirt/custom_hooks.log ;; "release") systemctl stop libvirt-nosleep@"$OBJECT" 2>&1 | tee -a /var/log/libvirt/custom_hooks.log - /bin/vfio-teardown.sh 2>&1 | tee -a /var/log/libvirt/custom_hooks.log + /usr/local/bin/vfio-teardown 2>&1 | tee -a /var/log/libvirt/custom_hooks.log ;; esac fi diff --git a/hooks/vfio-startup.sh b/hooks/vfio-startup similarity index 100% rename from hooks/vfio-startup.sh rename to hooks/vfio-startup diff --git a/hooks/vfio-teardown.sh b/hooks/vfio-teardown similarity index 100% rename from hooks/vfio-teardown.sh rename to hooks/vfio-teardown diff --git a/install_hooks.sh b/install_hooks.sh index 793a839..8a084c6 100755 --- a/install_hooks.sh +++ b/install_hooks.sh @@ -8,13 +8,13 @@ if test -e /etc/libvirt/hooks/qemu; then mv /etc/libvirt/hooks/qemu /etc/libvirt/hooks/qemu_last_backup fi -if test -e /bin/vfio-startup.sh; +if test -e /usr/local/bin/vfio-startup; then - mv /bin/vfio-startup.sh /bin/vfio-startup.sh.bkp + mv /usr/local/bin/vfio-startup /usr/local/bin/vfio-startup.bkp fi -if test -e /bin/vfio-teardown.sh; +if test -e /usr/local/bin/vfio-teardown; then - mv /bin/vfio-teardown.sh /bin/vfio-teardown.sh.bkp + mv /usr/local/bin/vfio-teardown /usr/local/bin/vfio-teardown.bkp fi if test -e /etc/systemd/system/libvirt-nosleep@.service; then @@ -22,10 +22,10 @@ then fi cp systemd-no-sleep/libvirt-nosleep@.service /etc/systemd/system/libvirt-nosleep@.service -cp hooks/vfio-startup.sh /bin/vfio-startup.sh -cp hooks/vfio-teardown.sh /bin/vfio-teardown.sh +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 /bin/vfio-startup.sh -chmod +x /bin/vfio-teardown.sh +chmod +x /usr/local/bin/vfio-startup +chmod +x /usr/local/bin/vfio-teardown chmod +x /etc/libvirt/hooks/qemu