From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: gnu/system/u-boot.scm Date: Tue, 26 Jul 2016 22:49:35 +0200 Message-ID: <877fc815wg.fsf@gnu.org> References: <20160721223501.3a989d55@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bS9IP-0007V4-K9 for guix-devel@gnu.org; Tue, 26 Jul 2016 16:49:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bS9IK-0004ON-Lx for guix-devel@gnu.org; Tue, 26 Jul 2016 16:49:44 -0400 In-Reply-To: <20160721223501.3a989d55@scratchpost.org> (Danny Milosavljevic's message of "Thu, 21 Jul 2016 22:35:01 +0200") 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 Hi! Danny Milosavljevic skribis: > below is my (untested!) attempt at an u-boot-configuration for use like t= his > > (bootloader (u-boot-configuration (device "/dev/sda"))) Nice! > It has been copied from gnu/system/grub.cfg and then I s/grub/u-boot/g an= d removed all the eyecandy stuff as far as I could. We should end up with U= -Boot showing a boot menu if=20 > > (1) The file "extlinux.conf" ends up on the first partition in the root i= f no partition was marked Active or > (2) The file "extlinux.conf" ends up on the partition which was marked Ac= tive using the flag in the MBR/GPT. > > and if someone installed u-boot-sunxi-with-spl.bin at a special sector us= ing dd or something. OK. We=E2=80=99ll need to find out exactly what needs to be done and imple= ment it, similar to =E2=80=98install-grub=E2=80=99 in (gnu build install). > NB: I think "device" would better be called "drive" or something. Everyth= ing is a device at this point. More important is that it isn't a partition = or a scanner or something :) To me =E2=80=9Cdevice=E2=80=9D is to be understood as =E2=80=9C/dev=E2=80= =9D file name in this context. > Now how do I make u-boot-configuration available in my /etc/config.scm ? = :) Simply (use-modules (gnu system u-boot)) in your config. However, at this point it won=E2=80=99t do anything useful obviously. :-) > NB: I also researched how to chainload grub and there's https://wiki.lina= ro.org/LEG/Engineering/Kernel/GRUBonUBOOT that describes it. Do we want tha= t? Dunno, it=E2=80=99s not clear to me what this buys us. > NB: menu-entry is unchanged. Might make sense to generalize it and move i= t to a common location. For now, let=E2=80=99s simply reuse the one from (gnu system grub). We can always move it to a more appropriate place later on. > (u-boot u-boot-configuration-u-boot ; package > (default (@ (gnu packages u-boot) (make-u-boot-package= board)))) The default value has invalid syntax. Should be simply: (default (make-u-boot-package board)) but I think this doesn=E2=80=99t work (=E2=80=98board=E2=80=99 will be unbo= und; yeah, counter-intuitive.) You could instead do (default #f) and call =E2=80=98make-u-boot-package=E2= =80=99 when that value is #f. > (define (eye-candy config root-fs system port) > "dummy" > (mlet* %store-monad ((image #f)) > (return (and image > #~(format #$port ""))))) > Simply remove it. :-) Now, with that in place, we need a few more bits: 1. An =E2=80=98install-u-boot=E2=80=99 procedure that would be the counte= rpart of =E2=80=98install-grub=E2=80=99, as discussed above; 2. (gnu system) should dispatch to either =E2=80=98grub-configuration-fil= e=E2=80=99 or =E2=80=98u-boot-configuration-file=E2=80=99 depending on whether the c= onfig contains a =E2=80=98grub-configuration=E2=80=99 or a =E2=80=98u-boot-c= onfiguration=E2=80=99 object. I=E2=80=99m probably forgetting other things, but this is the guts of it. (Note that I=E2=80=99m happy to provide guidance for the GuixSD side of thi= ngs, but I have almost no experience with U-Boot.) Thanks! Ludo=E2=80=99.