aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2018-05-18 02:40:55 +0200
committerDanny Milosavljevic <dannym@scratchpost.org>2018-05-18 02:55:55 +0200
commit2676628ffba9ef9cacbb0a15e6fd730a73e51f1f (patch)
treeec7713d27a8e9f8ef68a1efd1ec13f79a9773a11
parent39b40f16f2dfd074d6709a34c9e91321295f67da (diff)
downloadgnu-guix-2676628ffba9ef9cacbb0a15e6fd730a73e51f1f.tar
gnu-guix-2676628ffba9ef9cacbb0a15e6fd730a73e51f1f.tar.gz
gnu: Add u-boot-tools.
* gnu/packages/bootloaders.scm (u-boot-tools): New variable.
-rw-r--r--gnu/packages/bootloaders.scm41
1 files changed, 41 insertions, 0 deletions
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index af5d97288d..333f30e723 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -359,6 +359,47 @@ tree binary files. These are board description files used by Linux and BSD.")
also initializes the boards (RAM etc).")
(license license:gpl2+)))
+(define-public u-boot-tools
+ (package
+ (inherit u-boot)
+ (name "u-boot-tools")
+ (arguments
+ `(#:make-flags '("HOSTCC=gcc" "NO_SDL=1")
+ #:test-target "test"
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key make-flags #:allow-other-keys)
+ (call-with-output-file "configs/tools_defconfig"
+ (lambda (port)
+ (display "CONFIG_SYS_TEXT_BASE=0\n" port)))
+ (apply invoke "make" "tools_defconfig" make-flags)))
+ (replace 'build
+ (lambda* (#:key inputs make-flags #:allow-other-keys)
+ (apply invoke "make" "tools-only" make-flags)
+ (apply invoke "make" "envtools" make-flags)))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin")))
+ (for-each (lambda (name)
+ (install-file name bin))
+ '("tools/netconsole"
+ "tools/jtagconsole"
+ "tools/gen_eth_addr"
+ "tools/gen_ethaddr_crc"
+ "tools/img2srec"
+ "tools/mkenvimage"
+ "tools/dumpimage"
+ "tools/mkimage"
+ "tools/proftool"
+ "tools/fdtgrep"
+ "tools/env/fw_printenv"))
+ #t))))))
+ (description "U-Boot is a bootloader used mostly for ARM boards. It
+also initializes the boards (RAM etc). This package provides its
+board-independent tools.")))
+
(define (make-u-boot-package board triplet)
"Returns a u-boot package for BOARD cross-compiled for TRIPLET."
(let ((same-arch? (if (string-prefix? (%current-system)