summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Legoll <vincent.legoll@gmail.com>2020-04-13 01:28:31 +0200
committerGuix Patches Tester <>2020-04-14 19:17:00 +0100
commitcec838ddd2c389ceb1b64b632b572da663ab75e0 (patch)
tree989aaaa9e219de82db5ec634c2d350beda269b00
parentd94271f9ca68062435c35f788dcb22483b38ef31 (diff)
downloadpatches-series-3541.tar
patches-series-3541.tar.gz
gnu: Add iPXE.series-3541
* gnu/packages/bootloaders.scm (ipxe): New variable. Co-authored-by Tobias Geerinckx-Rice <me@tobias.gr>
-rw-r--r--gnu/packages/bootloaders.scm82
1 files changed, 81 insertions, 1 deletions
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index cadcc937e1..23dda99b2a 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -7,10 +7,11 @@
;;; Copyright © 2016, 2017 Danny Milosavljevic <dannym@scratchpost.org>
;;; Copyright © 2016, 2017 David Craven <david@craven.ch>
;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 nee <nee@cock.li>
;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
+;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -834,6 +835,85 @@ to Novena upstream, does not load u-boot.img from the first partition.")
`(("firmware" ,arm-trusted-firmware-rk3399)
,@(package-native-inputs base))))))
+(define-public ipxe
+ (package
+ (name "ipxe")
+ (version "1.20.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/ipxe/ipxe")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0w7h7y97gj9nqvbmsg1zp6zj5mpbbpckqbbx7bpp6k3ahy5fk8zp"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags
+ (list "ECHO_E_BIN_ECHO=echo"
+ "ECHO_E_BIN_ECHO_E=echo -e"
+
+ ;; cdrtools' mkisofs will silently ignore a missing isolinux.bin!
+ ;; Luckily xorriso is more strict.
+ (string-append "ISOLINUX_BIN=" (assoc-ref %build-inputs "syslinux")
+ "/share/syslinux/isolinux.bin")
+
+ ;; Build reproducibly.
+ "BUILD_ID_CMD=echo -n 0x78697547"
+ "everything")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'enter-source-directory
+ (lambda _ (chdir "src") #t))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (ipxe (string-append out "/lib/ipxe"))
+ (exts-re
+ "\\.(efi|efirom|iso|kkpxe|kpxe|lkrn|mrom|pxe|rom|usb)$")
+ (dirs '("bin" "bin-i386-linux" "bin-x86_64-pcbios"
+ "bin-x86_64-efi" "bin-x86_64-linux" "bin-i386-efi"))
+ (files (apply append
+ (map (lambda (dir)
+ (find-files dir exts-re)) dirs))))
+ (for-each (lambda (file)
+ (let* ((subdir (dirname file))
+ (fn (basename file))
+ (tgtsubdir (cond
+ ((string=? "bin" subdir) "")
+ ((string-prefix? "bin-" subdir)
+ (string-drop subdir 4)))))
+ (install-file file
+ (string-append ipxe "/" tgtsubdir))))
+ files))
+ #t))
+ (add-before 'configure 'use-xorriso
+ ;; Use xorriso's mkisofs emulation, which is better maintained and
+ ;; respects SOURCE_DATE_EPOCH to create a reproducible image.
+ (lambda _
+ (substitute* "util/geniso"
+ ((" genisoimage ") " \"xorriso -as mkisofs\" "))
+ #t))
+ (delete 'configure) ; no configure script
+ (add-after 'install 'leave-source-directory
+ (lambda _ (chdir "..") #t)))
+ #:tests? #f)) ; no test suite
+ (native-inputs
+ `(("perl" ,perl)
+ ("syslinux" ,syslinux)
+ ("xorriso" ,xorriso)))
+ (home-page "https://ipxe.org")
+ (synopsis "PXE-compliant network boot firmware")
+ (description "iPXE is a network boot firmware. It provides a full PXE
+implementation enhanced with additional features such as booting from: a web
+server via HTTP, an iSCSI SAN, a Fibre Channel SAN via FCoE, an AoE SAN, a
+wireless network, a wide-area network, an Infiniband network. It allows to
+control the boot process with a script. You can use iPXE to replace the
+existing PXE ROM on your network card, or you can chainload into iPXE to obtain
+the features of iPXE without the hassle of reflashing.")
+ (license license:gpl2+)))
+
(define-public vboot-utils
(package
(name "vboot-utils")