fix: Modify suggested fix to use similar checks to existing ones in quickemu

Removes (dumb human written) redundandant check in favour of other (intelligent, still human written but noticed by ai) checks instead.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
iFixit 2026-07-03 14:29:45 -07:00 committed by GitHub
parent 4360977c78
commit e649f69d1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 16 deletions

View File

@ -13,23 +13,14 @@ function ignore_msrs_always() {
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
# Code to verify if user has update-initramfs(debian exclusive? absent on arch ?) or mkinitcpio(present on arch) utility present
flag=0;
man update-initramfs &>2
a="$(echo $?)"
# echo $a
if [[ $a -eq 0 ]]; then
flag=1;
# Rebuild initramfs so the new kvm option takes effect
flag=0
if command -v update-initramfs &>/dev/null; then
flag=1
elif command -v mkinitcpio &>/dev/null; then
flag=2
else
man mkinitcpio &>2
a="$(echo $?)"
# echo $a
if [[ "$a" -eq 0 ]]; then
flag=2;
else
flag=3;
fi
flag=3
fi
# echo $flag;