From 87923d9f8ca51327e5ac5589f10548c9e6e5992b Mon Sep 17 00:00:00 2001 From: Bobby Date: Tue, 24 Feb 2026 09:28:27 +0530 Subject: fix: Simplify UEFI firmware detection logic in run script --- scripts/run.sh | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/scripts/run.sh b/scripts/run.sh index 94b0098..f6c5d5a 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -1,18 +1,22 @@ #!/bin/bash -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 +UEFI_FW="/opt/homebrew/share/qemu/edk2-x86_64-code.fd" +if [ ! -f "$UEFI_FW" ]; then + UEFI_FW="/usr/share/edk2/x64/OVMF_CODE.4m.fd" +fi +if [ ! -f "$UEFI_FW" ]; then + UEFI_FW="/usr/share/edk2/x64/OVMF_CODE.fd" +fi +if [ ! -f "$UEFI_FW" ]; then + UEFI_FW="/usr/share/OVMF/OVMF_CODE.fd" +fi +if [ ! -f "$UEFI_FW" ]; then + UEFI_FW="/usr/share/qemu/OVMF.fd" +fi -if [ -z "$UEFI_FW" ]; then - echo "UEFI firmware not found." +if [ ! -f "$UEFI_FW" ]; then + echo "Error: UEFI firmware not found" + echo "Please install OVMF/EDK2" exit 1 fi -- cgit v1.2.3