Skip to content

Commit 4c29b82

Browse files
committed
Fix incorrect firmware path suggestion for aarch64 in qemu.go
Previously, the error message in qemu.go incorrectly suggested copying "edk-/usr/bin/qemu-system-aarch64-code.fd" instead of the correct firmware file, "edk-aarch64-code.fd". This was due to qemuExe containing the full path to the QEMU binary instead of just the architecture name. This commit ensures that only "aarch64" is used in the error message, resulting in the correct suggestion: "edk-aarch64-code.fd". Signed-off-by: Kairvee Vaswani <[email protected]>
1 parent 188ebda commit 4c29b82

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/qemu/qemu.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,8 @@ func getFirmware(qemuExe string, arch limayaml.Arch) (string, error) {
11591159
}
11601160

11611161
if arch == limayaml.X8664 {
1162-
return "", fmt.Errorf("could not find firmware for %q (hint: try setting `firmware.legacyBIOS` to `true`)", qemuExe)
1162+
return "", fmt.Errorf("could not find firmware for %q (hint: try setting `firmware.legacyBIOS` to `true`)", arch)
11631163
}
1164-
return "", fmt.Errorf("could not find firmware for %q (hint: try copying the \"edk-%s-code.fd\" firmware to $HOME/.local/share/qemu/)", arch, qemuExe)
1164+
qemuArch := strings.TrimPrefix(filepath.Base(qemuExe), "qemu-system-")
1165+
return "", fmt.Errorf("could not find firmware for %q (hint: try copying the \"edk-%s-code.fd\" firmware to $HOME/.local/share/qemu/)", arch, qemuArch)
11651166
}

0 commit comments

Comments
 (0)