summary refs log tree commit diff
path: root/gnu/packages/firmware.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/firmware.scm')
-rw-r--r--gnu/packages/firmware.scm65
1 files changed, 65 insertions, 0 deletions
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 8c8949a5da..2e2b48162f 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -522,6 +522,7 @@ executing in M-mode.")
     (description "SeaBIOS is an implementation of a 16bit x86 BIOS.  SeaBIOS
 can run in an emulator or it can run natively on X86 hardware with the use of
 coreboot.")
+    (supported-systems '("i686-linux" "x86_64-linux"))
     ;; Dual licensed.
     (license (list license:gpl3+ license:lgpl3+
                    ;; src/fw/acpi-dsdt.dsl is lgpl2
@@ -530,6 +531,70 @@ coreboot.")
                    ;; cpl with a linking exception.
                    license:cpl1.0))))
 
+(define-public edk2-tools
+  (package
+    (name "edk2-tools")
+    (version "202211")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/tianocore/edk2")
+                    (commit (string-append "edk2-stable" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1264542mm0mffjcmw5sw34h94n405swz5z56rw1ragp3j62144iy"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:make-flags
+           #~(list (string-append "BUILD_CC=" #$(cc-for-target)))
+           #:test-target "Tests"
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'change-directory
+                 (lambda _
+                   (chdir "BaseTools")))
+               (add-after 'change-directory 'disable-some-tools
+                 (lambda _
+                   ;; Disable building brotli and xz, since we package them
+                   ;; separately, and it would require fetching submodules.
+                   (substitute* "Source/C/GNUmakefile"
+                     (("^[[:blank:]]+BrotliCompress[[:blank:]]+\\\\")
+                      "\\")
+                     (("^[[:blank:]]+LzmaCompress[[:blank:]]+\\\\")
+                      "\\"))))
+               (replace 'build
+                 (lambda* (#:key (make-flags #~'()) #:allow-other-keys)
+                   ;; The default build target also runs tests.
+                   (apply invoke "make" "-C" "Source/C" make-flags)))
+               (delete 'configure)
+               (replace 'install
+                 (lambda _
+                   (mkdir #$output)
+                   (copy-recursively "Source/C/bin"
+                                     (string-append #$output "/bin")))))))
+    (native-inputs
+     (list python-wrapper))
+    (inputs
+     (list `(,util-linux "lib")))       ;for libuuid
+    (home-page
+     "https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Tools-List")
+    (synopsis "EFI development tools")
+    (description
+     "This package contains tools for processing UEFI firmware content.
+Executables included are:
+
+@itemize
+@item @code{EfiRom}: Build Option ROM images.
+@item @code{GenFfs}: Generate FFS files.
+@item @code{GenFv}: Generate a PI firmware volume image.
+@item @code{GenFw}: Get image data from PE32 files.
+@item @code{GenSec}: Generate EFI_SECTION type files.
+@item @code{VfrCompile}: Parse preprocessed UEFI and Framework VFR files.
+@item @code{VolInfo}: Display the contents of a firmware volume.
+@end itemize")
+    (license license:bsd-2)))
+
 (define-public ovmf
   (let ((commit "13a50a6fe1dcfa6600c38456ee24e0f9ecf51b5f")
         (revision "1"))