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 "0sbn6am3k5lqafycggh1g964fcwjwnh0i9hhwrk4ncrwzphz55h1"))))
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 @acronym{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 "1y76wy65y6k10mjl2dm5hb5ms475alr4s080xzj8y833x01xvf3m"))))
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 ("libuuid" ,util-linux "lib")
116 ("openssl" ,openssl)))
117 (synopsis "EFI signing tools")
118 (description "This package provides tools for signing EFI binaries.")
119 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git/")
120 (license license:gpl3+)))
122 (define-public efitools
131 (url "https://git.kernel.org/pub/scm/linux/kernel/git/jejb/efitools.git")
132 (commit (string-append "v" version))))
133 (file-name (git-file-name name version))
136 "0jabgl2pxvfl780yvghq131ylpf82k7banjz0ksjhlm66ik8gb1i"))))
137 (build-system gnu-build-system)
139 `(#:tests? #f ; No tests exist.
143 (modify-phases %standard-phases
144 (add-after 'unpack 'patch
145 (lambda* (#:key inputs outputs #:allow-other-keys)
146 (substitute* "Make.rules"
147 (("/usr/include/efi")
148 (string-append (assoc-ref inputs "gnu-efi")
150 (("\\$\\(DESTDIR\\)/usr")
151 (string-append (assoc-ref outputs "out")))
153 (string-append (assoc-ref inputs "gnu-efi")
156 (add-after 'unpack 'patch-more-shebangs
157 (lambda* (#:key inputs #:allow-other-keys)
158 (substitute* "xxdi.pl"
161 (assoc-ref inputs "perl")
164 (delete 'configure))))
166 `(("help2man" ,help2man)
168 ("perl-file-slurp" ,perl-file-slurp)
169 ("sbsigntools" ,sbsigntools)))
171 `(("gnu-efi" ,gnu-efi)
172 ("openssl" ,openssl)))
173 (synopsis "EFI tools (key management, variable management)")
174 (description "This package provides EFI tools for EFI key management
175 and EFI variable management.")
176 (home-page "https://blog.hansenpartnership.com/efitools-1-4-with-linux-key-manipulation-utilities-released/")
177 ;; Programs are under GPL 2.
178 ;; Library routines (in lib/) are under LGPL 2.1.
179 ;; Compiling/linking/using OpenSSL is permitted.
180 (license (list license:gpl2
183 (define-public efilinux
190 (url "https://github.com/mfleming/efilinux")
191 (commit (string-append "efilinux-" version))))
192 (file-name (git-file-name name version))
195 "0b4nxzr3wl5v4b52r79iw1arfgasz26xb38r2blw9v2qz2s1q9w2"))))
196 (build-system gnu-build-system)
200 ,@(match (%current-system)
206 (string-append "INCDIR=" (assoc-ref %build-inputs "gnu-efi")
208 (string-append "LIBDIR=" (assoc-ref %build-inputs "gnu-efi")
210 #:tests? #f ; No tests exist.
212 (modify-phases %standard-phases
215 (lambda* (#:key outputs #:allow-other-keys)
216 (install-file "efilinux.efi"
217 (string-append (assoc-ref outputs "out")
221 `(("gnu-efi" ,gnu-efi)))
222 (synopsis "Minimal Linux loader for UEFI")
223 (description "This package provides a minimal Linux loader as an UEFI
225 (home-page "https://github.com/mfleming/efilinux")
226 (license license:bsd-2)))