From dba2a2b7e182e902ad6cb1fb8ee809b95331b2d3 Mon Sep 17 00:00:00 2001 From: Michael Tinsay Date: Fri, 7 Oct 2022 09:49:09 +0800 Subject: [PATCH] Added check if file exists in ignore_msrs_always --- quickemu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickemu b/quickemu index 52ac41b..64d2f62 100755 --- a/quickemu +++ b/quickemu @@ -10,7 +10,7 @@ function ignore_msrs_always() { # Make sure the host has /etc/modprobe.d if [ -d /etc/modprobe.d ]; then # Skip if ignore_msrs is already enabled, assumes initramfs has been rebuilt - if grep -lq 'ignore_msrs=Y' /etc/modprobe.d/kvm-quickemu.conf >/dev/null 2>&1; then + if [ ! -f /etc/modprobe.d/kvm-quickemu.conf ] || grep -lq 'ignore_msrs=Y' /etc/modprobe.d/kvm-quickemu.conf >/dev/null 2>&1; then echo "options kvm ignore_msrs=Y" | sudo tee /etc/modprobe.d/kvm-quickemu.conf sudo update-initramfs -k all -u fi