Skip to content

Commit

Permalink
boot-qemu.py: Handle LoongArch's EFI firmware location change
Browse files Browse the repository at this point in the history
Loongson renamed this file in [1], which results in a 404 file getting
downloaded as the firmware, so QEMU obviously refuses to start. If the
old firmware file does not exist locally already, download and use the
new file name.

Link: loongson/Firmware@638906d [1]
Signed-off-by: Nathan Chancellor <[email protected]>
  • Loading branch information
nathanchance committed Jul 19, 2024
1 parent ddb4c86 commit 4e29d0d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions boot-qemu.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,10 @@ def __init__(self):
bios = Path(utils.BOOT_UTILS, 'images', self._initrd_arch,
'edk2-loongarch64-code.fd')
if not bios.exists():
# Loongson renamed this in https://github.com/loongson/Firmware/commit/638906de6143283d86c70d80f4e9a30b50731c24
# so download it to the new location if it does not exist already.
bios = bios.with_name('QEMU_EFI.fd')

bios.parent.mkdir(exist_ok=True, parents=True)
firmware_url = f"https://github.com/loongson/Firmware/raw/main/LoongArchVirtMachine/{bios.name}"
utils.green(
Expand Down

0 comments on commit 4e29d0d

Please sign in to comment.