From 4360977c78c587ee33a014fdc1abb1729bd3819d Mon Sep 17 00:00:00 2001 From: iFixit <133802824+Silver-Crystal@users.noreply.github.com> Date: Fri, 3 Jul 2026 14:13:44 -0700 Subject: [PATCH 1/4] Implement fallback for ignore_msrs_always function Implements fallback in the absence of 'update-initramfs' utility(the command fails on arch). The counterpart on arch would be 'mkinitcpio' (possibly mkinitcpio -p linux ) --- quickemu | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/quickemu b/quickemu index 9b65359..41f1623 100755 --- a/quickemu +++ b/quickemu @@ -12,7 +12,44 @@ function ignore_msrs_always() { # 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 echo "options kvm ignore_msrs=Y" | sudo tee /etc/modprobe.d/kvm-quickemu.conf - sudo update-initramfs -k all -u + + # 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; + else + man mkinitcpio &>2 + a="$(echo $?)" + # echo $a + if [[ "$a" -eq 0 ]]; then + flag=2; + else + flag=3; + fi + fi + + # echo $flag; + + case "$flag" in + 1) + sudo update-initramfs -k all -u + ;; + 2) + sudo mkinitcpio -p linux + echo "Ran mkinitcpio -p linux" + ;; + 3) + echo "ERROR! User does not have update-initramfs or mkinitcpio installed, please find out respective utility to update/regenrate intiramfs." + echo "Run respective command for 'sudo update-initramfs -k all -u'(debian) or 'sudo mkinitcpio -p linux'(arch)" + exit 1 + ;; + esac + + fi else echo "ERROR! /etc/modprobe.d was not found, I don't know how to configure this system." From e649f69d1b397489feacdb0635ef8f8e00b680f9 Mon Sep 17 00:00:00 2001 From: iFixit <133802824+Silver-Crystal@users.noreply.github.com> Date: Fri, 3 Jul 2026 14:29:45 -0700 Subject: [PATCH 2/4] 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> --- quickemu | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/quickemu b/quickemu index 41f1623..30a1aa5 100755 --- a/quickemu +++ b/quickemu @@ -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; From 76d5360dbec7dfb530a6302a7e3b2042e6ff28cc Mon Sep 17 00:00:00 2001 From: iFixit <133802824+Silver-Crystal@users.noreply.github.com> Date: Fri, 3 Jul 2026 14:35:17 -0700 Subject: [PATCH 3/4] Fix: Update mkinitcpio command to use -P option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use ```mkinitcpio -P``` instead of hardcoded ```mkintcpio -p linux``` (fix suggested by cube and validated by copilot) (manpage for mkinitcpio says ```-P, --allpresets Process all presets contained in /etc/mkinitcpio.d. See the -p option for more detail about presets. -p, --preset preset Build initramfs image(s) according to specified preset. This may be a file in /etc/mkinitcpio.d (without the .preset extension) or a full, absolute path to a file. This option may be specified mul‐ tiple times to process multiple presets.``` This does seem to remove hard coded path --- quickemu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quickemu b/quickemu index 30a1aa5..e4a5397 100755 --- a/quickemu +++ b/quickemu @@ -30,8 +30,8 @@ function ignore_msrs_always() { sudo update-initramfs -k all -u ;; 2) - sudo mkinitcpio -p linux - echo "Ran mkinitcpio -p linux" + sudo mkinitcpio -P + echo "Ran mkinitcpio -P" ;; 3) echo "ERROR! User does not have update-initramfs or mkinitcpio installed, please find out respective utility to update/regenrate intiramfs." From 932e9b1fa01c6ff630607187ecfe43fa5f045f12 Mon Sep 17 00:00:00 2001 From: iFixit <133802824+Silver-Crystal@users.noreply.github.com> Date: Fri, 3 Jul 2026 14:37:18 -0700 Subject: [PATCH 4/4] Fix: Update typo in echo command for mkinitcpio in error message. --- quickemu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickemu b/quickemu index e4a5397..c816d6d 100755 --- a/quickemu +++ b/quickemu @@ -35,7 +35,7 @@ function ignore_msrs_always() { ;; 3) echo "ERROR! User does not have update-initramfs or mkinitcpio installed, please find out respective utility to update/regenrate intiramfs." - echo "Run respective command for 'sudo update-initramfs -k all -u'(debian) or 'sudo mkinitcpio -p linux'(arch)" + echo "Run respective command for 'sudo update-initramfs -k all -u'(debian) or 'sudo mkinitcpio -P'(arch)" exit 1 ;; esac