[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] gnu: Add u-boot.
From: |
Danny Milosavljevic |
Subject: |
Re: [PATCH] gnu: Add u-boot. |
Date: |
Mon, 29 Aug 2016 20:27:52 +0200 |
> +(define (make-u-boot-package board triplet xgcc)
...
> + (begin
> + (display "Invalid boardname. Valid boardnames would
> have been:")
> + (newline)
> + (system* "ls" "-1" "configs")
> + #f)))))
I've improved the error message if the board name is unknown:
#:phases
(modify-phases %standard-phases
(replace
'configure
(lambda* (#:key outputs make-flags #:allow-other-keys)
(let ((configname (string-append ,board "_defconfig")))
(if (zero? (system* "ls" (string-append "configs/" configname)))
(zero? (apply system* "make" `(,@make-flags ,configname)))
(begin
(use-modules (ice-9 match) (ice-9 format))
(display "Invalid boardname. Valid boardnames would have
been:")
(newline)
(let ((dir (opendir "configs")))
(do ((filename (readdir dir) (readdir dir)))
((eof-object? filename))
(if (string-suffix? "_defconfig" filename)
(format #t
"- ~A\n"
(string-drop-right filename
(string-length
"_defconfig")))))
(closedir dir))
#f)))))
(replace 'install
(lambda* (#:key outputs make-flags #:allow-other-keys)
(let ((out (string-append (assoc-ref outputs "out") "/libexec")))
(mkdir-p out)
(for-each (lambda (name)
(let ((outname (string-append out "/" name)))
(mkdir-p (dirname outname))
(copy-file name outname)))
(find-files "." ".*\\.(bin|efi)$"))))))))))