Subject: [PATCH 04/11] gnu: Add ovmf-i686.

From: Efraim Flashner <[email-masked]>
Date: Mon, 13 May 2024 11:21:53 +0300

* gnu/packages/firmware.scm (ovmf-i686): New variable.

Change-Id: Ie5702435695e24ed1d2731152a89b0aeb9a050dd
---
 gnu/packages/firmware.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 40ca541437..ab39f8d0d2 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1002,6 +1002,28 @@ (define-public ovmf-x86-64
                              "OVMF_CODE"
                              "OVMF_VARS"))))))))))))
 
+(define-public ovmf-i686
+  (let ((base (make-ovmf-firmware "i686")))
+    (package
+      (inherit base)
+      (arguments
+        (substitute-keyword-arguments (package-arguments base)
+          ((#:phases phases)
+           #~(modify-phases #$phases
+               (replace 'install
+                 (lambda _
+                   (let ((fmw (string-append #$output "/share/firmware")))
+                     (mkdir-p fmw)
+                     (for-each
+                       (lambda (file)
+                         (copy-file
+                           (string-append "Build/OvmfIa32/RELEASE_GCC"
+                                          "/FV/" file ".fd")
+                           (string-append fmw "/" (string-downcase file) "_ia32.bin")))
+                       (list "OVMF"
+                             "OVMF_CODE"
+                             "OVMF_VARS"))))))))))))
+
 (define-public ovmf
   (let ((toolchain-ver "GCC5"))
     (package
-- 
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