Subject: bug#40579: closed ([RFC PATCH] add iPXE.)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 14 Jan 2021 08:34:02 +0000

Your bug report

#40579: [RFC PATCH] add iPXE.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
40579: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=40579
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: [RFC PATCH] add iPXE.
From: Vincent Legoll <[email-masked]>
To: [email-masked]
Date: Thu, 14 Jan 2021 09:33:24 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Thanks a lot Danny !

-- 
Vincent Legoll

Subject: [RFC PATCH] add iPXE.
From: Vincent Legoll <[email-masked]>
To: [email-masked]
Date: Sun, 12 Apr 2020 19:59:05 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Here is a patch for review that adds iPXE.

The licensing is "interesting", see:

https://ipxe.org/licensing

Is that a problem ?

There was no real install target in makefile, so I

added one, any hints on how to write that in a

cleaner way ?

I've put all firmware & rom images in $(out)/bin

Is there a better subdirectory to put such files ?

The double with-directory-excursion could be

handled with a single phase cd'ing into src, but I

can't find where I've seen that...

WDYT ?

-- 

Vincent Legoll

>From d0fcf7a69a7503e8fb5b61a4c1109ebfed208a40 Mon Sep 17 00:00:00 2001
From: Vincent Legoll <[email-masked]>
Date: Sun, 12 Apr 2020 19:54:47 +0200
Subject: [PATCH] gnu: Add iPXE.

* gnu/packages/bootloaders.scm (ipxe): New variable.
---
 gnu/packages/bootloaders.scm | 54 ++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index cadcc937e1..4b1f209540 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2019 nee <[email-masked]>
 ;;; Copyright © 2019 Mathieu Othacehe <[email-masked]>
 ;;; Copyright © 2020 Björn Höfling <[email-masked]>
+;;; Copyright © 2020 Vincent Legoll <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -834,6 +835,59 @@ 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
+     `(#:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'add-real-make-install
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (substitute* "src/Makefile"
+                        (("^install :")
+                         (string-append "install :"
+                                        "\n\t@$(MKDIR) -p "
+                                        (assoc-ref outputs "out") "/bin"
+                                        "\n\t@$(CP) $(ALL) "
+                                        (assoc-ref outputs "out") "/bin"
+                                        "\n\n__old_install :")))
+                      #t))
+                  (delete 'configure)
+                  (replace 'build
+                     (lambda _ (with-directory-excursion "src"
+                                 (invoke "make" "-j" (number->string
+                                         (parallel-job-count))))))
+                  (replace 'install
+                     (lambda _ (with-directory-excursion "src"
+                                 (invoke "make" "install")))))
+       #:tests? #f))
+    (native-inputs
+     `(("perl" ,perl)
+       ("syslinux" ,syslinux)
+       ("cdrtools" ,cdrtools)
+       ("mtools" ,mtools)
+       ("xz" ,xz)))
+    (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.26.0