[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ARM: Installation and Booting; was: Re: GuixSD on ARM;

From: Danny Milosavljevic
Subject: Re: ARM: Installation and Booting; was: Re: GuixSD on ARM;
Date: Thu, 14 Jul 2016 00:22:13 +0200

Work-in-progress gnu/packages/u-boot.scm :

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 Danny Milosavljevic <address@hidden>
;;; 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
;;; 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 <>.

(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)))

;; FIXME move somewhere more fitting
;; FIXME add
 (massive amount of patches)
(define-public device-tree-compiler
    (name "device-tree-compiler")
    (version "1.4.0")
    (source (origin
             (method url-fetch)
             ;; or <>
             (uri (string-append 
                                 "device-tree-compiler_" version 
             (modules '((guix build utils)))
               '(substitute* "Makefile"
    (home-page "";)
    (synopsis "Compiles Device Tree Source Files (.dts)")
    (description "dtc compiles Device Tree Source Files to Device Tree Binary 
These are hardware (board) description files (used by Linux and BSD).")
    (license gpl2)
    (build-system gnu-build-system)
     `(("bison" ,bison)
       ("flex" ,flex)))
     `(#:make-flags `("CC=gcc" ,(string-append "HOME=" (assoc-ref %outputs 
"out"))) ; Note: or patch out PREFIX
       #:phases (modify-phases %standard-phases
          (delete 'configure))))))

(define u-boot
    (name "u-boot")
    (version "2016.07")
    (source (origin
             (method url-fetch)
             (uri (string-append ""; version 
    (home-page "";)
    (synopsis "ARM Universal Bootloader")
    (description "FIXME")
    (license gpl2)
      `(("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
                   (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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]