fix: make function ignore_msrs_always work

With the previous version the file was never written if it not existed before, logic bug.
This commit is contained in:
Gitsarry 2024-08-13 09:03:01 +02:00 committed by Martin Wimpress
parent 35f8e9333d
commit 18cdda254b
1 changed files with 1 additions and 1 deletions

View File

@ -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 ! 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