summaryrefslogtreecommitdiff
path: root/gnu/packages/firmware.scm
diff options
context:
space:
mode:
authorRoman Scherer <roman@burningswell.com>2026-03-14 13:58:31 +0100
committerEfraim Flashner <efraim@flashner.co.il>2026-03-15 14:49:06 +0200
commite320469cf025c8adb2b7ffc16e5b0e0fb02be6eb (patch)
tree2151cd3ca363e81da61a736a13219b31549cdea6 /gnu/packages/firmware.scm
parent8cc2c817357b3c2d1fbb68b5f644d04b5e4c37a8 (diff)
gnu: ovmf-aarch64: Pad firmware to 64 MiB for QEMU compatibility.
QEMU's virt machine on AArch64 requires pflash devices to be exactly 64 MiB. The raw QEMU_EFI.fd produced by EDK2 is only ~2 MiB, causing GRUB EFI tests to fail with: cfi.pflash01 device requires 67108864 bytes, pflash0 block backend provides 2097152 bytes Pad the firmware file to match, as Nix does. * gnu/packages/firmware.scm (ovmf-aarch64)[arguments]: Pad ovmf_aarch64.bin to 64 MiB with truncate-file. Change-Id: I589325294f264b0af69a9a0261c35d9a862e03c5 Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
Diffstat (limited to 'gnu/packages/firmware.scm')
-rw-r--r--gnu/packages/firmware.scm12
1 files changed, 8 insertions, 4 deletions
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 24e1fc83627..74f68927354 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1253,11 +1253,15 @@ Virtual Machines. OVMF contains a sample UEFI firmware for QEMU and KVM.")
#~(modify-phases #$phases
(replace 'install
(lambda _
- (let ((fmw (string-append #$output "/share/firmware")))
+ (let ((fmw (string-append #$output "/share/firmware"))
+ (build-dir "Build/ArmVirtQemu-AARCH64/RELEASE_GCC/FV"))
(mkdir-p fmw)
- (copy-file (string-append "Build/ArmVirtQemu-AARCH64/"
- "RELEASE_GCC/FV/QEMU_EFI.fd")
- (string-append fmw "/ovmf_aarch64.bin"))))))))))))
+ ;; QEMU's virt machine requires 64 MiB pflash devices on
+ ;; AArch64. Pad the firmware files to match.
+ (copy-file (string-append build-dir "/QEMU_EFI.fd")
+ (string-append fmw "/ovmf_aarch64.bin"))
+ (truncate-file (string-append fmw "/ovmf_aarch64.bin")
+ (* 64 1024 1024))))))))))))
(define-public ovmf-arm
(let ((base (make-ovmf-firmware "armhf")))