Subject: [PATCH 6/9] gnu: ovmf-arm: Update installed firmware.

From: Efraim Flashner <[email-masked]>
Date: Fri, 21 Mar 2025 10:53:07 +0200

* gnu/packages/firmware.scm (ovmf-arm)[arguments]: Adjust the 'install
phase to install another binary and to truncate the file to the expected
length.

Change-Id: Ic3319c88ed03c9c80e466ef78eae60837158a456
---
 gnu/packages/firmware.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 049fd9246fb..c8220fe3d66 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1212,9 +1212,14 @@ (define-public ovmf-arm
                  (lambda _
                    (let ((fmw (string-append #$output "/share/firmware")))
                     (mkdir-p fmw)
-                    (copy-file (string-append "Build/ArmVirtQemu-ARM/"
-                                              "RELEASE_GCC/FV/QEMU_EFI.fd")
-                               (string-append fmw "/ovmf_arm.bin"))))))))))))
+                    (with-directory-excursion "Build/ArmVirtQemu-ARM/RELEASE_GCC/FV"
+                      ;; Make the files the desired length and then install them
+                      (truncate-file "QEMU_EFI.fd" (* 64 1024 1024))
+                      (truncate-file "QEMU_VARS.fd" (* 64 1024 1024))
+                      (copy-file "QEMU_VARS.fd"
+                                 (string-append fmw "/ovmf_vars_arm.bin"))
+                      (copy-file "QEMU_EFI.fd"
+                                 (string-append fmw "/ovmf_arm.bin")))))))))))))
 
 (define-public ovmf-riscv64
   (let ((base (make-ovmf-firmware "riscv64")))
-- 
Efraim Flashner   <[email-masked]>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted