unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Tobias Geerinckx-Rice via Guix-patches via <guix-patches@gnu.org>
To: 40579@debbugs.gnu.org
Cc: Vincent Legoll <vincent.legoll@gmail.com>
Subject: [bug#40579] [PATCH v2] gnu: Add iPXE.
Date: Mon, 13 Apr 2020 01:28:31 +0200	[thread overview]
Message-ID: <20200412232831.5876-1-me@tobias.gr> (raw)
In-Reply-To: <87tv1ommhu.fsf@nckx>

From: Vincent Legoll <vincent.legoll@gmail.com>

* gnu/packages/bootloaders.scm (ipxe): New variable.

Co-authored-by Tobias Geerinckx-Rice <me@tobias.gr>
---

Vincent, Danny,

Danny Milosavljevic wrote:
> P.S. The following ROMs are not reproducible:

The ROMS were easily fixed by setting BUILD_ID_CMD to a static string.

The ISO was a pain.  cdrtools' mkisofs seems to predate the concept of
reproducible builds.  Switching to the modern Xorriso exposed another
bug: we weren't setting ISOLINUX_BIN, and cdrtools' mkisofs happily
created an ISO that probably never worked(?).  Luckily, Xorriso
complained loudly.

The image still isn't reproducible, but it has much fewer dates in it
now and it actually boots ;-) [citation needed].

I've silenced some other annoying warnings during the build, and
applied some of my suggestions from my previous mail (not all though —
please do send a V3).

Neither mtools nor XZ were ever used.  Why were they there?

Kind regards,

T G-R

 gnu/packages/bootloaders.scm | 70 +++++++++++++++++++++++++++++++++++-
 1 file changed, 69 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index cadcc937e1..112b079c1b 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,73 @@ 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 (string-append name "-" version "-checkout"))
+              (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")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'enter-source-directory
+           (lambda _ (chdir "src") #t))
+         (add-before 'configure 'add-make-install-target
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (ipxe (string-append out "/share/ipxe")))
+               (substitute* "Makefile"
+                 (("^install :")
+                  (string-append "install :"
+                                 "\n\t@$(MKDIR) -p " ipxe
+                                 "\n\t@$(CP) $(ALL) " ipxe
+                                 "\n\n__old_install :")))
+               #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")
-- 
2.25.2

  reply	other threads:[~2020-04-12 23:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-12 17:59 [bug#40579] [RFC PATCH] add iPXE Vincent Legoll
2020-04-12 18:47 ` Tobias Geerinckx-Rice via Guix-patches via
2020-04-12 18:58   ` Tobias Geerinckx-Rice via Guix-patches via
2020-04-12 19:46   ` Danny Milosavljevic
2020-04-12 21:18     ` Tobias Geerinckx-Rice via Guix-patches via
2020-04-12 23:28       ` Tobias Geerinckx-Rice via Guix-patches via [this message]
2020-04-14 15:11         ` [bug#40579] [PATCH v3] gnu: Add iPXE Vincent Legoll
2020-04-15 20:41         ` [bug#40579] [PATCH v2] " Danny Milosavljevic
2020-04-15 20:55           ` Vincent Legoll
2020-06-09 19:31           ` Brice Waegeneire
2020-06-09 19:58             ` Vincent Legoll
2020-06-09 20:11               ` Brice Waegeneire
2021-01-12 21:01                 ` Vincent Legoll
2021-01-12 21:44 ` [bug#40579] [PATCH 1/2] " Vincent Legoll
2021-01-12 21:44   ` [bug#40579] [PATCH 2/2] gnu: ipxe: Update to 1.21.1 Vincent Legoll
2021-01-12 21:47   ` [bug#40579] [PATCH 1/2] gnu: Add iPXE Vincent Legoll
2021-01-14  0:53     ` Danny Milosavljevic
2021-01-14  8:33 ` bug#40579: [RFC PATCH] add iPXE Vincent Legoll

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200412232831.5876-1-me@tobias.gr \
    --to=guix-patches@gnu.org \
    --cc=40579@debbugs.gnu.org \
    --cc=me@tobias.gr \
    --cc=vincent.legoll@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).