From 5b6519e2af33286d5f9bb0d75e7d76f2caec7d7b Mon Sep 17 00:00:00 2001 From: Bobby Date: Sat, 14 Feb 2026 00:37:44 +0530 Subject: refactor: Enhance UEFI firmware detection logic in run script --- scripts/run.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/run.sh b/scripts/run.sh index 66f3d0b..94b0098 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -1,8 +1,19 @@ #!/bin/bash -UEFI_FW="/opt/homebrew/share/qemu/edk2-x86_64-code.fd" -if [ ! -f "$UEFI_FW" ]; then - UEFI_FW="/usr/share/edk2/x64/OVMF_CODE.fd" +for fw in \ + /opt/homebrew/share/qemu/edk2-x86_64-code.fd \ + /usr/share/edk2/x64/OVMF_CODE.fd \ + /usr/share/edk2/x64/OVMF_CODE.4m.fd +do + if [ -f "$fw" ]; then + UEFI_FW="$fw" + break + fi +done + +if [ -z "$UEFI_FW" ]; then + echo "UEFI firmware not found." + exit 1 fi qemu-system-x86_64 \ @@ -10,4 +21,4 @@ qemu-system-x86_64 \ -drive if=pflash,format=raw,readonly=on,file="$UEFI_FW" \ -drive file=iso/akiba.img,format=raw \ -m 2048M \ - -serial stdio \ No newline at end of file + -serial stdio -- cgit v1.2.3