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: guix bootloader selection - wip patch
Date: Thu, 28 Jul 2016 14:34:38 +0200	[thread overview]
Message-ID: <874m7aj601.fsf@gnu.org> (raw)
In-Reply-To: <20160727222924.07209026@scratchpost.org> (Danny Milosavljevic's message of "Wed, 27 Jul 2016 22:29:24 +0200")

Danny Milosavljevic <dannym@scratchpost.org> skribis:

> so far I came up with the patch to Guix below for the actual bootloader selection.

Nice!

> Some places are still broken. Search for "FIXME" below.
>
> For example I need a way to find out what the bootloader config file is supposed to be called in the new routine 'install-bootloader . It will get (derivation->output-path bootloader-configuration-file) as argument. Given it, can I still find out whether the filename is "grub.cfg" or "extlinux.conf"? Is that safe enough?

[...]

> +(define* (install-u-boot extlinux.conf device mount-point)
> +  "Install U-Boot with EXTLINUX.CONF on DEVICE, which is assumed to be mounted on
> +MOUNT-POINT. FIXME is that correct?"
> +    (install-bootloader-config extlinux.conf
> +                               (string-append mount-point
> +                                              "/extlinux.conf"))
> +    (unless (zero? (system* "u-boot-install"
> +                            (string-append "--boot-directory=" mount-point)
> +                            device))
> +      (error "failed to install U-Boot")))

Really, installing U-Boot is as simple as this?  If it is, that’s
perfect.  :-)

> -(define* (operating-system-grub.cfg os #:optional (old-entries '()))
> -  "Return the GRUB configuration file for OS.  Use OLD-ENTRIES to populate the
> +(define (bootloader-configuration-device bootloader-configuration)
> +    (match bootloader-configuration
> +      (($ <grub-configuration> config)
> +       (grub-configuration-device config))
> +      (($ <u-boot-configuration> config)
> +       (u-boot-configuration-device config))))

Very good, this is where the bootloader selection should occur.  It
seems to me that it’s enough to find out whether to call ‘install-grub’
or ‘install-u-boot’, no?

I would write it as:

  (match bootloader-configuration
    ((? grub-configuration? config)
     (grub-configuration-device config))
    ((? u-boot-configuration? config)
     (u-boot-configuration-device config)))

which does the same thing but allows us to avoid exporting
<grub-configuration> and <u-boot-configuration> (better to keep them
private so that external code doesn’t rely on the structure layout.)

I see three separate things here:

  1. Replacing “grub” by “bootloader” in the API (cosmetic change);

  2. Adding the build-side code to install U-Boot;

  3. Adding the host-side code to handle <u-boot-configuration> and do
     the right thing.

To facilitate review, could you separate these three things?

Also, not critical, but could you send patches as ‘text/x-patch’ MIME
attachments so that my email client can perform color highlighting?  :-)

I’m happy to see fast progress on this, thank you!

Ludo’.

  reply	other threads:[~2016-07-28 12:34 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 ` gnu/system/u-boot.scm Ludovic Courtès
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 [this message]
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=874m7aj601.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.