From mboxrd@z Thu Jan 1 00:00:00 1970 From: Efraim Flashner Subject: Re: ARM: Installation and Booting; was: Re: GuixSD on ARM; Date: Thu, 14 Jul 2016 10:12:51 +0300 Message-ID: <20160714071251.GB11033@debian-netbook> References: <5f0fbebb97ed071ef040f4bb0e3f046c@d4n1.org> <87vb0a10ys.fsf@elephly.net> <20160713111136.645c3248@scratchpost.org> <20160714002213.41c4fe2c@scratchpost.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="U+BazGySraz5kW0T" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNapV-0005Vf-TS for guix-devel@gnu.org; Thu, 14 Jul 2016 03:13:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNapS-0000CR-8r for guix-devel@gnu.org; Thu, 14 Jul 2016 03:13:05 -0400 Received: from flashner.co.il ([178.62.234.194]:50782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNapR-00007U-Sj for guix-devel@gnu.org; Thu, 14 Jul 2016 03:13:02 -0400 Content-Disposition: inline In-Reply-To: <20160714002213.41c4fe2c@scratchpost.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Danny Milosavljevic Cc: guix-devel@gnu.org --U+BazGySraz5kW0T Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 14, 2016 at 12:22:13AM +0200, Danny Milosavljevic wrote: > Work-in-progress gnu/packages/u-boot.scm : >=20 > ;;; GNU Guix --- Functional package management for GNU > ;;; Copyright =C2=A9 2016 Danny Milosavljevic > ;;; > ;;; 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 . >=20 > (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))) >=20 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 > (uri (string-append "https://launchpad.net/ubuntu/+archive/p= rimary/+files/" > "device-tree-compiler_" version "+dfsg.o= rig.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 Bi= nary Files.=20 > 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=3Dgcc" ,(string-append "HOME=3D" (assoc-ref %ou= tputs "out"))) ; Note: or patch out PREFIX > #:phases (modify-phases %standard-phases > (delete 'configure)))))) >=20 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-" v= ersion ".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=3Dgcc") ; 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 "_def= config")) #| example: A20-OLinuXino-Lime2_defconfig |#) > (system* "echo" configname) > (zero? (system* "make" "HOSTCC=3Dgcc" configname)) > )))))))) >=20 > (define-public u-boot-A20-OLinuXino-Lime2 > (package (inherit u-boot) > (name "u-boot-A20-OLinuXino-Lime2"))) >=20 > ; something should: > ; - create boot.cmd > ; - run mkimage -C none -A arm -T script -d boot.cmd boot.scr=20 > ; - put boot.scr on the first partition > ; - dd if=3Du-boot-sunxi-with-spl.bin of=3D/dev/sdX bs=3D1024 seek=3D8 > ; ^^^ better make sure no partition is there (or just a dummy partitio= n) >=20 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=3Darm-board=3D/dev/sdX arm-config.scm' --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --U+BazGySraz5kW0T Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJXhztwAAoJEPTB05F+rO6TqYAP/1ZK01FBWhgKAdemimP/J7Dr wQJjvY/4uEdPPIqUtyYeoXeawSIJnBOS5vdVpghBxEfMTL8ew1kLHlqAyTjKWGse zT3H9oSImnT4tF4PE/jSUzXUlJ+mhhh8hlx6FWNedRBENsOR2mdELGHKwYdxe2P+ +X54GfJRw78sEUvTWwgByFrQ3y49ZVN4wSm51XHhG74iWNvydgraQG6X7XKKsoJA 9/kivzCiZMARQfLw3HCiWNPTtGDE7utHgB0IxEkM8PKCVgs2jw25cG0EaJIw5XML gr4Rm07PdW2du5D13PZF6klrmEVNNOxze442EM4c5o8oubiLDVyYGv2BnxbmU2Gj Y+Ii8y7GG4L/aXmWRSAIJI4Ger7GDJDEyqHXMUrmCUmLvlHLuAkQNuT+wIwGvOnx hxmvSMwuLW9H/Z4/lTHHsiEBylC7hwWFu5IAwJ0vQJcGybv2u0p1hh5mpntUPI89 lkT49Q3D2UHImQESiw+6KjQORLpMGFouls2B8yl/m/uxvYp8CN1PmBE8U4gDTobl ZTo03r9eAyxRUQffmIxPsbee5q29iO0IeDVHVUSVFqlqpGaqX06GWXx7pm2+Ov25 LPCWrFvxnbEhi2V+fu6Nttbb88wSD+tZGzYZkx4yeSE0Q3g54v60WWOqenA0pEoe 8rezp2Izq9TTnuKC4hA4 =Ibfu -----END PGP SIGNATURE----- --U+BazGySraz5kW0T--