all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: gnu/system/u-boot.scm
Date: Tue, 26 Jul 2016 22:49:35 +0200	[thread overview]
Message-ID: <877fc815wg.fsf@gnu.org> (raw)
In-Reply-To: <20160721223501.3a989d55@scratchpost.org> (Danny Milosavljevic's message of "Thu, 21 Jul 2016 22:35:01 +0200")

Hi!

Danny Milosavljevic <dannym@scratchpost.org> skribis:

> below is my (untested!) attempt at an u-boot-configuration for use like this
>
>   (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 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 https://wiki.linaro.org/LEG/Engineering/Kernel/GRUBonUBOOT 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,
counter-intuitive.)

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

Thanks!

Ludo’.

  parent reply	other threads:[~2016-07-26 20:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21 20:35 gnu/system/u-boot.scm Danny Milosavljevic
2016-07-22  9:59 ` gnu/system/u-boot.scm Chris Marusich
2016-07-22 18:21   ` gnu/system/u-boot.scm Danny Milosavljevic
2016-07-26 20:49 ` Ludovic Courtès [this message]
2016-07-27  9:32   ` gnu/system/u-boot.scm Danny Milosavljevic
2016-07-27 20:29     ` guix bootloader selection - wip patch Danny Milosavljevic
2016-07-28 12:34       ` Ludovic Courtès
2016-07-29  8:21         ` Danny Milosavljevic
2016-08-02  9:49           ` Ludovic Courtès
2016-08-02  9:49           ` Ludovic Courtès
2016-07-28 12:26     ` gnu/system/u-boot.scm Ludovic Courtès
2016-10-06  8:12   ` gnu/system/u-boot.scm Danny Milosavljevic
2016-10-06 17:24     ` gnu/system/u-boot.scm David Craven

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=877fc815wg.fsf@gnu.org \
    --to=ludo@gnu.org \
    --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.