all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: gnu/system/u-boot.scm
Date: Thu, 6 Oct 2016 10:12:23 +0200	[thread overview]
Message-ID: <20161006101223.389e56ac@scratchpost.org> (raw)
In-Reply-To: <877fc815wg.fsf@gnu.org>

Hi,

so now that all of it works, I'd like to propose to change how it's done completely (muhahaha).

Ludo wrote:
>   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 think it would be better if (gnu system) installed *both* the grub configuration file *and* the u-boot configuration file.

The main advantage would be if the user already had a bootloader, it would be possible to leave the bootloader form off completely in /etc/config.scm . The bootloader configurations would still be updated and the right one should be picked up by the bootloader (Note: Libreboot checks for "grub/libreboot_grub.cfg"; U-Boot checks for "extlinux.conf" (and others); Grub checks for "grub/grub.cfg").

(This is in order to support bootloaders that are in ROM or Flash, mostly. One usually doesn't update those [I guess it doesn't hurt if you install another dummy bootloader on disk, though]. VMs also don't need a bootloader - but do need the config)

Another advantage would be that there would be no "u-boot-configuration" object and the user would not have to choose between it and "grub-configuration". It would be all the same configuration object (by then erroneously called "grub-configuration" - which we can keep for backward compatibility I guess). 

The programs "grub-install" and (future) "u-boot-install" expect a fixed filename for their config file - so they are not confused by it either. So that's neutral :)

There's no need to provide two different configuration objects (they are almost completely the same - save the output procedure). I'd say it's a maintenance advantage not to have them.

And the only disadvantage would be that the bootloader installation procedure would have to check whether "grub-install" exists. If it does, invoke it. Otherwise invoke "u-boot-install". Essentially success would be if either invocation succeeded (that is: the respective executable was found). [We could also add a "grub-install" executable to the u-boot packages if we wanted to avoid that]

grub-configuration would need just one new field "installer" which would list the package of the bootloader-to-install, if any. 

And there would need to be a new procedure "grub-configuration-files" with multiple files *instead* of "grub-configuration-file". (Think of "grub" as "bootloader" in this name)

operating-system-grub.cfg would also need to return multiple files (and maybe their target names, too?).

If we wanted to be backward compatible (probably), we could install grub if there was no field "installer" specified. (Although in a non-backward-compatible world I'd prefer if it installed no bootloader in that case - it wouldn't even have any fallout if it now didn't install the bootloader on existing systems)

What do you think?

If we want to do it, could you help me write "grub-configuration-files" ?

grub-configuration-file seems to use gexp->derivation at the end (which probably form a store monad). Can I just return a Scheme list of those or how would this work?

Do I then need to carry the target filename in a pair?

"grub.cfg" is a gc root. How would this need to be adapted?

If we later wanted to modify GuixSD to switch over to special configurations (although I don't see why we would), we can still do that without backward compat problems. So this wouldn't lock us in.

  parent reply	other threads:[~2016-10-06  8:12 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
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   ` Danny Milosavljevic [this message]
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=20161006101223.389e56ac@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@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.