From: Efraim Flashner <efraim@flashner.co.il>
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: guix-devel@gnu.org
Subject: Re: ARM: Installation and Booting; was: Re: GuixSD on ARM;
Date: Thu, 14 Jul 2016 10:12:51 +0300 [thread overview]
Message-ID: <20160714071251.GB11033@debian-netbook> (raw)
In-Reply-To: <20160714002213.41c4fe2c@scratchpost.org>
[-- Attachment #1: Type: text/plain, Size: 6115 bytes --]
On Thu, Jul 14, 2016 at 12:22:13AM +0200, Danny Milosavljevic wrote:
> Work-in-progress gnu/packages/u-boot.scm :
>
> ;;; GNU Guix --- Functional package management for GNU
> ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> ;;; GNU Guix is free software; you can redistribute it and/or modify it
> ;;; under the terms of the GNU General Public License as published by
> ;;; the Free Software Foundation; either version 3 of the License, or (at
> ;;; your option) any later version.
> ;;;
> ;;; GNU Guix is distributed in the hope that it will be useful, but
> ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> ;;; GNU General Public License for more details.
> ;;;
> ;;; You should have received a copy of the GNU General Public License
> ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
>
> (define-module (gnu packages u-boot)
> #:use-module (guix download)
> #:use-module (guix packages)
> #:use-module ((guix licenses) #:select (gpl2))
> #:use-module (guix build-system gnu)
> #:use-module (guix build-system trivial)
> #:use-module (gnu packages)
> #:use-module (gnu packages python)
> #:use-module (gnu packages bison) ; for DTC
> #:use-module (gnu packages flex) ; for DTC
> #:use-module (srfi srfi-1)
> #:use-module ((srfi srfi-1) #:select (last)))
>
I forget why I cloned the repo, but I have one with a similar name
hanging around my computer
git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git
Also I think the same file as u-boot is the right place for it.
> ;; FIXME move somewhere more fitting
> ;; FIXME add https://launchpad.net/ubuntu/+archive/primary/+files/device-tree-compiler_1.4.0+dfsg-2ubuntu1.diff.gz (massive amount of patches)
> (define-public device-tree-compiler
> (package
> (name "device-tree-compiler")
> (version "1.4.0")
> (source (origin
> (method url-fetch)
> ;; or <https://git.kernel.org/cgit/utils/dtc/dtc.git>
> (uri (string-append "https://launchpad.net/ubuntu/+archive/primary/+files/"
> "device-tree-compiler_" version "+dfsg.orig.tar.gz"))
> (sha256
> (base32
> "0hzsqkpbgl73fblpnaiczirgwn0hapa7z478xjy6vvkqljpa3ygm"))
> (modules '((guix build utils)))
as long as you're deleting 'configure you could replace configure with
the substitute.
> (snippet
> '(substitute* "Makefile"
> (("/usr/bin/install")
> "install")))))
> (home-page "https://git.kernel.org/cgit/utils/dtc/dtc.git")
> (synopsis "Compiles Device Tree Source Files (.dts)")
> (description "dtc compiles Device Tree Source Files to Device Tree Binary Files.
> These are hardware (board) description files (used by Linux and BSD).")
> (license gpl2)
> (build-system gnu-build-system)
> (native-inputs
> `(("bison" ,bison)
> ("flex" ,flex)))
> (arguments
> `(#:make-flags `("CC=gcc" ,(string-append "HOME=" (assoc-ref %outputs "out"))) ; Note: or patch out PREFIX
> #:phases (modify-phases %standard-phases
> (delete 'configure))))))
>
I think this is the right approach, with a general u-boot that each
board can inherit and make work for them.
> (define u-boot
> (package
> (name "u-boot")
> (version "2016.07")
> (source (origin
> (method url-fetch)
> (uri (string-append "ftp://ftp.denx.de/pub/u-boot/u-boot-" version ".tar.bz2"))
> (sha256
> (base32
> "0lqj4ckmfqiap8mc6z2d5albs3g2h5mzccbn60hsgxhabhibfkwp"))))
we could probably add a snippet here and remove most of the
architectures, but at 11MB its probably not worth it.
> (home-page "http://www.denx.de/wiki/U-Boot/")
> (synopsis "ARM Universal Bootloader")
> (description "FIXME")
> (license gpl2)
> (native-inputs
> `(("python" ,python) ; FIXME required version?
> ("device-tree-compiler" ,device-tree-compiler)))
> (build-system gnu-build-system)
> (arguments ; FIXME #:tests? #f
> `(#:make-flags '("HOSTCC=gcc") ; ignored?
> #:phases (modify-phases %standard-phases
> (replace
> 'configure
> (lambda* (#:key outputs #:allow-other-keys)
> (let* ((out (assoc-ref outputs "out"))
> (parts (string-split (basename out) #\-))
> (nameparts (cdddr parts))
> (name (string-join nameparts "-"))
> (configprefix (string-take name (string-index-right name #\-)))
> (configname (string-append configprefix "_defconfig")) #| example: A20-OLinuXino-Lime2_defconfig |#)
> (system* "echo" configname)
> (zero? (system* "make" "HOSTCC=gcc" configname))
> ))))))))
>
> (define-public u-boot-A20-OLinuXino-Lime2
> (package (inherit u-boot)
> (name "u-boot-A20-OLinuXino-Lime2")))
>
> ; something should:
> ; - create boot.cmd
> ; - run mkimage -C none -A arm -T script -d boot.cmd boot.scr
> ; - put boot.scr on the first partition
> ; - dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
> ; ^^^ better make sure no partition is there (or just a dummy partition)
>
with dd being so potentially destructive I think we should have the
users run the dd command themselves, or it could be included as part of
a `guix system init --target=arm-board=/dev/sdX arm-config.scm'
--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-07-14 7:13 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-12 11:19 GuixSD on ARM Daniel Pimentel
2016-07-13 6:55 ` Ricardo Wurmus
2016-07-13 9:11 ` ARM: Installation and Booting; was: Re: GuixSD on ARM; Danny Milosavljevic
2016-07-13 22:22 ` Danny Milosavljevic
2016-07-14 7:12 ` Efraim Flashner [this message]
2016-07-19 19:50 ` Danny Milosavljevic
2016-07-19 20:07 ` [PATCH] Add gnu/packages/u-boot.scm with all the boards that u-boot supports right now Danny Milosavljevic
2016-07-21 12:37 ` Ludovic Courtès
2016-07-21 17:56 ` Danny Milosavljevic
2016-07-22 13:15 ` Ludovic Courtès
2016-07-23 14:11 ` Andreas Enge
2016-08-01 19:13 ` [PATCH v2] gnu: Add u-boot, device-tree-compiler Danny Milosavljevic
2016-08-01 19:18 ` [PATCH v3] " Danny Milosavljevic
2016-08-01 19:58 ` [PATCH v4] " Danny Milosavljevic
2016-08-01 20:05 ` [PATCH v5] " Danny Milosavljevic
2016-08-02 7:11 ` [PATCH v6] " Danny Milosavljevic
2016-08-21 8:23 ` Danny Milosavljevic
2016-08-21 9:47 ` David Craven
2016-08-22 19:40 ` Danny Milosavljevic
2016-08-22 21:18 ` David Craven
2016-08-23 1:03 ` David Craven
2016-08-24 0:15 ` Danny Milosavljevic
2016-07-14 16:20 ` ARM: Installation and Booting; was: Re: GuixSD on ARM; Andreas Enge
2016-07-13 12:57 ` GuixSD on ARM Ludovic Courtès
2016-07-19 1:47 ` Eric Bavier
2016-08-15 20:14 ` Christopher Allan Webber
2016-09-11 13:05 ` Andreas Enge
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160714071251.GB11033@debian-netbook \
--to=efraim@flashner.co.il \
--cc=dannym@scratchpost.org \
--cc=guix-devel@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.