[Top][All Lists]

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

Re: gnu/system/u-boot.scm

From: Ludovic Courtès
Subject: Re: gnu/system/u-boot.scm
Date: Tue, 26 Jul 2016 22:49:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)


Danny Milosavljevic <address@hidden> skribis:

> below is my (untested!) attempt at an u-boot-configuration for use like this
>   (bootloader (u-boot-configuration (device "/dev/sda")))


> It has been copied from gnu/system/grub.cfg and then I s/grub/u-boot/g and 
> removed all the eyecandy stuff as far as I could. We should end up with 
> U-Boot showing a boot menu if 
> (1) The file "extlinux.conf" ends up on the first partition in the root if no 
> partition was marked Active or
> (2) The file "extlinux.conf" ends up on the partition which was marked Active 
> using the flag in the MBR/GPT.
> and if someone installed u-boot-sunxi-with-spl.bin at a special sector using 
> dd or something.

OK.  We’ll need to find out exactly what needs to be done and implement
it, similar to ‘install-grub’ in (gnu build install).

> NB: I think "device" would better be called "drive" or something. Everything 
> is a device at this point. More important is that it isn't a partition or a 
> scanner or something :)

To me “device” is to be understood as “/dev” 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’t do anything useful obviously.  :-)

> NB: I also researched how to chainload grub and there's 
> that describes it. 
> Do we want that?

Dunno, it’s not clear to me what this buys us.

> NB: menu-entry is unchanged. Might make sense to generalize it and move it to 
> a common location.

For now, let’s 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’t work (‘board’ will be unbound; yeah,

You could instead do (default #f) and call ‘make-u-boot-package’ 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 ‘install-u-boot’ procedure that would be the counterpart of
     ‘install-grub’, as discussed above;

  2. (gnu system) should dispatch to either ‘grub-configuration-file’ or
     ‘u-boot-configuration-file’ depending on whether the config
     contains a ‘grub-configuration’ or a ‘u-boot-configuration’ object.

I’m probably forgetting other things, but this is the guts of it.

(Note that I’m happy to provide guidance for the GuixSD side of things,
but I have almost no experience with U-Boot.)



reply via email to

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