1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2019 Danny Milosavljevic <dannym@scratchpost.org>
3 ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; This file is part of GNU Guix.
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21 (define-module (gnu packages efi)
22 #:use-module (gnu packages autotools)
23 #:use-module (gnu packages bash)
24 #:use-module (gnu packages linux)
25 #:use-module (gnu packages man)
26 #:use-module (gnu packages perl)
27 #:use-module (gnu packages pkg-config)
28 #:use-module (gnu packages tls)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix packages)
34 #:use-module (guix utils)
35 #:use-module (ice-9 match))
37 (define-public gnu-efi
44 (uri (string-append "mirror://sourceforge/gnu-efi/"
45 "gnu-efi-" version ".tar.bz2"))
47 (base32 "1ffnc4xbzfggs37ymrgfx76j56kk2644c081ivhr2bjkla9ag3gj"))))
48 (build-system gnu-build-system)
50 `(#:tests? #f ; none exist
52 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
54 (modify-phases %standard-phases
55 (delete 'configure))))
56 (synopsis "EFI toolchain")
57 (description "This package provides an EFI (Extensible Firmware
58 Interface) toolchain for building programs that can run in the
59 environment presented by Intel's EFI.")
60 (home-page "https://directory.fsf.org/wiki/GNU_EFI")
61 ;; Distribution is allowed only when accepting all those licenses.
62 (license (list license:bsd-2 license:bsd-3 license:bsd-4 license:expat))))
64 (define-public sbsigntools
73 (url "https://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git")
74 (commit (string-append "v" version))
76 (file-name (git-file-name name version))
78 (base32 "0gc3xmp73xl7z4nkwz4qy960rdflmx7k4ksgyblcnia9smvsir6y"))))
79 (build-system gnu-build-system)
82 (modify-phases %standard-phases
83 (add-after 'unpack 'patch-more-shebangs
84 (lambda* (#:key inputs #:allow-other-keys)
85 (substitute* "lib/ccan.git/tools/create-ccan-tree"
88 (assoc-ref inputs "bash")
91 (add-after 'unpack 'patch
92 (lambda* (#:key inputs outputs #:allow-other-keys)
93 (substitute* '("configure.ac"
96 (string-append (assoc-ref inputs "gnu-efi")
99 (string-append (assoc-ref inputs "gnu-efi")
102 (add-after 'unpack 'setenv
107 `(("autoconf" ,autoconf)
108 ("automake" ,automake)
110 ("help2man" ,help2man)
111 ("pkg-config" ,pkg-config)
112 ("util-linux" ,util-linux))) ; getopt
114 `(("gnu-efi" ,gnu-efi)
115 ("openssl" ,openssl)))
116 (synopsis "EFI signing tools")
117 (description "This package provides tools for signing EFI binaries.")
118 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git/")
119 (license license:gpl3+)))
121 (define-public efitools
130 (url "https://git.kernel.org/pub/scm/linux/kernel/git/jejb/efitools.git")
131 (commit (string-append "v" version))))
132 (file-name (git-file-name name version))
135 "0jabgl2pxvfl780yvghq131ylpf82k7banjz0ksjhlm66ik8gb1i"))))
136 (build-system gnu-build-system)
138 `(#:tests? #f ; No tests exist.
142 (modify-phases %standard-phases
143 (add-after 'unpack 'patch
144 (lambda* (#:key inputs outputs #:allow-other-keys)
145 (substitute* "Make.rules"
146 (("/usr/include/efi")
147 (string-append (assoc-ref inputs "gnu-efi")
149 (("\\$\\(DESTDIR\\)/usr")
150 (string-append (assoc-ref outputs "out")))
152 (string-append (assoc-ref inputs "gnu-efi")
155 (add-after 'unpack 'patch-more-shebangs
156 (lambda* (#:key inputs #:allow-other-keys)
157 (substitute* "xxdi.pl"
160 (assoc-ref inputs "perl")
163 (delete 'configure))))
165 `(("help2man" ,help2man)
167 ("perl-file-slurp" ,perl-file-slurp)
168 ("sbsigntools" ,sbsigntools)))
170 `(("gnu-efi" ,gnu-efi)
171 ("openssl" ,openssl)))
172 (synopsis "EFI tools (key management, variable management)")
173 (description "This package provides EFI tools for EFI key management
174 and EFI variable management.")
175 (home-page "https://blog.hansenpartnership.com/efitools-1-4-with-linux-key-manipulation-utilities-released/")
176 ;; Programs are under GPL 2.
177 ;; Library routines (in lib/) are under LGPL 2.1.
178 ;; Compiling/linking/using OpenSSL is permitted.
179 (license (list license:gpl2
182 (define-public efilinux
189 (url "https://github.com/mfleming/efilinux.git")
190 (commit (string-append "efilinux-" version))))
191 (file-name (git-file-name name version))
194 "0b4nxzr3wl5v4b52r79iw1arfgasz26xb38r2blw9v2qz2s1q9w2"))))
195 (build-system gnu-build-system)
199 ,@(match (%current-system)
205 (string-append "INCDIR=" (assoc-ref %build-inputs "gnu-efi")
207 (string-append "LIBDIR=" (assoc-ref %build-inputs "gnu-efi")
209 #:tests? #f ; No tests exist.
211 (modify-phases %standard-phases
214 (lambda* (#:key outputs #:allow-other-keys)
215 (install-file "efilinux.efi"
216 (string-append (assoc-ref outputs "out")
220 `(("gnu-efi" ,gnu-efi)))
221 (synopsis "Minimal Linux loader for UEFI")
222 (description "This package provides a minimal Linux loader as an UEFI
224 (home-page "https://github.com/mfleming/efilinux")
225 (license license:bsd-2)))