summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2019-09-03 02:29:16 +0200
committerDanny Milosavljevic <dannym@scratchpost.org>2019-09-03 02:36:36 +0200
commit9112c78af5ed872f25f7d01a8d7553a3778ea25f (patch)
tree603cfe0d74b1b86c91cf3c856a2fa13e8bdfc60b /gnu
parentbb7b9a5449ebdb7f5d9e730a5ea058fd98862eb7 (diff)
downloadguix-9112c78af5ed872f25f7d01a8d7553a3778ea25f.tar.gz
gnu: u-boot: Provide make-buildroot-u-boot-package.
* gnu/packages/bootloaders.scm (make-u-boot-package): Modify.
(make-buildroot-u-boot-package): New public procedure.
(make-u-boot-sunxi64-package): Modify.
(buildroot->guix-package): Use make-buildroot-u-boot-package.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/bootloaders.scm27
1 files changed, 11 insertions, 16 deletions
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 41a2de9706..ed4ca599d3 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -552,7 +552,10 @@ board-independent tools.")))
          #:phases
          (modify-phases %standard-phases
            (replace 'configure
-             (lambda* (#:key outputs make-flags #:allow-other-keys)
+             (lambda* (#:key inputs outputs make-flags #:allow-other-keys)
+               (and=> (assoc-ref inputs "bl31")
+                      (lambda (bl31)
+                        (setenv "BL31" (string-append bl31 "/bl31.bin"))))
                (let ((config-name (string-append ,board "_defconfig")))
                  (if (file-exists? (string-append "configs/" config-name))
                      (apply invoke "make" `(,@make-flags ,config-name))
@@ -599,6 +602,12 @@ board-independent tools.")))
                   uboot-files)
                  #t)))))))))
 
+(define-public (make-buildroot-u-boot-package board buildroot-configuration-flags triplet)
+  "Given a BUILDROOT-CONFIGURATION-FLAGS (the 'y and 'n parts of a
+BUILDROOT-CONFIGURATION), return a fitting u-boot package"
+  (let ((base (make-u-boot-package board triplet)))
+    (package (inherit base))))
+
 (define-public u-boot-vexpress
   (make-u-boot-package "vexpress_ca9x4" "arm-linux-gnueabihf"))
 
@@ -636,22 +645,8 @@ it fits within common partitioning schemes.")
   (let ((base (make-u-boot-package board triplet)))
     (package
       (inherit base)
-      (arguments
-        (substitute-keyword-arguments (package-arguments base)
-          ((#:phases phases)
-           `(modify-phases ,phases
-              (add-after 'unpack 'set-environment
-                (lambda* (#:key inputs #:allow-other-keys)
-                  (let ((bl31 (string-append (assoc-ref inputs "firmware")
-                                             "/bl31.bin")))
-                    (setenv "BL31" bl31)
-                    ;; This is necessary when we're using the bundled dtc.
-                    ;(setenv "PATH" (string-append (getenv "PATH") ":"
-                    ;                              "scripts/dtc"))
-                    )
-                  #t))))))
       (native-inputs
-       `(("firmware" ,arm-trusted-firmware-sun50i-a64)
+       `(("bl31" ,arm-trusted-firmware-sun50i-a64)
          ,@(package-native-inputs base))))))
 
 (define-public u-boot-pine64-plus