From 4e29d0d7914d38aa9fd2c0ae37c2138fb2fddec6 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Fri, 19 Jul 2024 16:05:45 -0700 Subject: [PATCH] boot-qemu.py: Handle LoongArch's EFI firmware location change 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: https://github.com/loongson/Firmware/commit/638906de6143283d86c70d80f4e9a30b50731c24 [1] Signed-off-by: Nathan Chancellor --- boot-qemu.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boot-qemu.py b/boot-qemu.py index eef5cd0..198b126 100755 --- a/boot-qemu.py +++ b/boot-qemu.py @@ -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(