all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mathieu Othacehe <m.othacehe@gmail.com>
Cc: 26339@debbugs.gnu.org, David Craven <david@craven.ch>
Subject: bug#26339: [PATCH 02/18] system: Add extlinux support.
Date: Mon, 08 May 2017 22:06:18 +0200	[thread overview]
Message-ID: <87mvanjepx.fsf@gnu.org> (raw)
In-Reply-To: <20170402135242.2958-2-m.othacehe@gmail.com> (Mathieu Othacehe's message of "Sun, 2 Apr 2017 15:52:26 +0200")

Hello!

Sorry for the delay, and thanks for reminding me of this patch.

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

> From: David Craven <david@craven.ch>
>
> * gnu/system.scm (operating-system): Add default bootloader.
>   (operating-system-grub.cfg): Use bootloader-configuration-file-procedure.
> * gnu/system/grub.scm (bootloader-configuration->grub-configuration): New
>   variable.
>   (grub-configuration-file): Use bootloader-configuration->grub-configuration.
> * guix/scripts/system.scm (profile-grub-entries): Rename system->grub-entry to
>   system->boot-parameters and adjust accordingly.
>   (perform-action): Make bootloader optional. Use
>   bootloader-configuration-device.
> * gnu/system/bootloader.scm: New file.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
> * tests/system.scm: Adjust operating-system to new API.
> * tests/guix-system.sh: Adjust operating-system to new API.

[...]

> +(define-record-type* <bootloader-configuration>
> +  bootloader-configuration make-bootloader-configuration
> +  bootloader-configuration?
> +  (bootloader                      bootloader-configuration-bootloader     ; package
> +                                   (default #f))
> +  (device                          bootloader-configuration-device         ; string
> +                                   (default #f))
> +  (menu-entries                    bootloader-configuration-menu-entries   ; list of <boot-parameters>
> +                                   (default '()))
> +  (default-entry                   bootloader-configuration-default-entry  ; integer
> +                                   (default 0))
> +  (timeout                         bootloader-configuration-timeout        ; integer
> +                                   (default 5))
> +  (configuration-file-location     bootloader-configuration-file-location
> +                                   (default #f))
> +  (configuration-file-procedure    bootloader-configuration-file-procedure ; procedure
> +                                   (default #f))
> +  (install-procedure               bootloader-configuration-install-procedure ; procedure
> +                                   (default #f))
> +  (additional-configuration        bootloader-configuration-additional-configuration ; record
> +                                   (default #f)))
> +

To avoid mistakes, I think we should remove default values for fields
that really need to be set.  For example, ‘configuration-file-location’
and ‘install-procedure’ should probably not have a default value.

I would rename ‘configuration-file-location’ to ‘configuration-file’.

I’m fine with ‘configuration-file-procedure’, but ‘generator’ is OK too.

I would make ‘bootloader’ a delayed field (see the ‘patches’ field of
<origin> for an example of that.)  That would avoid loading the package
modules upfront.

> +;;;
> +;;; Bootloader configurations.
> +;;;
> +
> +(define* (extlinux-configuration #:optional (config (bootloader-configuration)))
> +  (bootloader-configuration
> +   (inherit config)
> +   (configuration-file-location "/boot/extlinux/extlinux.conf")
> +   (configuration-file-procedure extlinux-configuration-file)))
> +
> +(define* (grub-configuration #:optional (config (bootloader-configuration)))
> +  (bootloader-configuration
> +   (inherit config)
> +   (bootloader (@ (gnu packages bootloaders) grub))
> +   (configuration-file-location "/boot/grub/grub.cfg")
> +   (configuration-file-procedure grub-configuration-file)
> +   (install-procedure install-grub)
> +   (additional-configuration
> +    (let ((additional-config (bootloader-configuration-additional-configuration config)))
> +      (if additional-config additional-config %default-theme)))))
> +
> +(define* (grub-efi-configuration #:optional (config (bootloader-configuration)))
> +  (bootloader-configuration
> +   (inherit (grub-configuration config))
> +   (bootloader (@ (gnu packages bootloaders) grub-efi))))
> +
> +(define* (syslinux-configuration #:optional (config (bootloader-configuration)))
> +  (bootloader-configuration
> +   (inherit (extlinux-configuration config))
> +   (bootloader (@ (gnu packages bootloaders) syslinux))
> +   (install-procedure install-syslinux)))

So it looks like this is the reason for all the default values.

What about distinguishing two things: bootloader configuration, and
bootloader implementation?  This would be akin to the relation between
<package> and <build-system>.

We’d have <bootloader-configuration>, but without the ‘bootloader’,
‘install-procedure’, ‘configuration-file-procedure’, and
‘configuration-file’ fields.  Instead of those 4 fields, we’d have a
single ‘bootloader’ field whose value would be a <bootloader> record.

The <bootloader> record would contain these 4 fields (package,
install-procedure, configuration-file, configuration-file-procedure),
maybe along with a ‘name’ field to aid debugging.

The <bootloader> record would define the implementation (GRUB, extlinux,
u-boot, etc.) while <bootloader-configuration> would be purely
configuration.

How does that sound?

We could do:

  (define grub-bootloader
    (bootloader
      (package grub)
      …))

in (gnu bootloader grub).

Likewise we’d define ‘extlinux-bootloader’ in (gnu bootloader extlinux).

The (gnu system) module would include (gnu bootloader), but it would not
include (gnu bootloader grub) nor (gnu bootloader extlinux).  Users
would include one of these in their config file instead.

> --- a/tests/system.scm
> +++ b/tests/system.scm
> @@ -36,7 +36,6 @@
>      (host-name "komputilo")
>      (timezone "Europe/Berlin")
>      (locale "en_US.utf8")
> -    (bootloader (grub-configuration (device "/dev/sdX")))
>      (file-systems (cons %root-fs %base-file-systems))

In gnu/system.scm, there’s:

> +  (bootloader operating-system-bootloader         ; <bootloader-configuration>
> +              (default (extlinux-configuration)))


If there was a default value here, I think it’d rather be GRUB ;-), but
probably we’d better not have a default at all.  How would the
installation device be found?

Thanks a lot, and sorry for the loooong delay!

Ludo’.

  parent reply	other threads:[~2017-05-08 20:07 UTC|newest]

Thread overview: 204+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-02 13:49 bug#26339: [PATCH 00/18] wip: Support non grub bootloaders Mathieu Othacehe
2017-04-02 13:52 ` bug#26339: [PATCH 01/18] system: Pass <bootloader-parameter> to grub Mathieu Othacehe
2017-04-02 13:52   ` bug#26339: [PATCH 02/18] system: Add extlinux support Mathieu Othacehe
2017-04-15 16:03     ` Danny Milosavljevic
2017-05-08 20:06     ` Ludovic Courtès [this message]
2017-05-09  7:38       ` Mathieu Othacehe
2017-05-09  9:51         ` Ludovic Courtès
2017-05-09 14:30           ` Mathieu Othacehe
2017-05-09 20:40             ` Ludovic Courtès
2017-05-12  0:02               ` Danny Milosavljevic
2017-05-12  8:26                 ` Ludovic Courtès
2017-05-12 11:26                   ` Danny Milosavljevic
2017-05-12 11:36                     ` Ludovic Courtès
2017-05-12 12:18                       ` Mathieu Othacehe
2017-05-13  9:53                         ` Danny Milosavljevic
2017-05-14  7:49                           ` Mathieu Othacehe
2017-05-09 10:25         ` Ludovic Courtès
2017-05-09 14:32           ` Mathieu Othacehe
2017-04-02 13:52   ` bug#26339: [PATCH 03/18] scripts: system: Rename --no-grub option to --no-bootloader Mathieu Othacehe
2017-04-15 10:10     ` Danny Milosavljevic
2017-04-16  9:58       ` Ludovic Courtès
2017-04-02 13:52   ` bug#26339: [PATCH 04/18] bootloader: Add install procedures and use them Mathieu Othacehe
2017-04-15 16:22     ` Danny Milosavljevic
2017-04-15 17:15       ` Mathieu Othacehe
2017-04-16 21:37         ` Danny Milosavljevic
2017-04-17  8:49           ` Mathieu Othacehe
2017-04-18  8:23             ` Ludovic Courtès
2017-04-02 13:52   ` bug#26339: [PATCH 05/18] system: Rename operating-system-grub.cfg to operating-system-bootcfg Mathieu Othacehe
2017-04-15 12:44     ` Danny Milosavljevic
2017-04-02 13:52   ` bug#26339: [PATCH 06/18] vm: Reword grub.cfg to boot.cfg Mathieu Othacehe
2017-04-15 12:43     ` Danny Milosavljevic
2017-04-02 13:52   ` bug#26339: [PATCH 07/18] system: Add bootloader type Mathieu Othacehe
2017-04-15 16:26     ` Danny Milosavljevic
2017-04-15 17:23       ` Mathieu Othacehe
2017-04-15 20:16         ` Danny Milosavljevic
2017-04-02 13:52   ` bug#26339: [PATCH 08/18] bootloader: Stop using grub module Mathieu Othacehe
2017-04-15 13:33     ` Danny Milosavljevic
2017-04-15 16:44     ` Danny Milosavljevic
2017-04-02 13:52   ` bug#26339: [PATCH 09/18] scripts: system: Move save-load-path-excursion and save-environment-excursion macros to the top Mathieu Othacehe
2017-04-15 10:35     ` Danny Milosavljevic
2017-04-15 10:46       ` Mathieu Othacehe
2017-04-15 11:30         ` Danny Milosavljevic
2017-04-15 11:41           ` Mathieu Othacehe
2017-04-15 11:52             ` Danny Milosavljevic
2017-04-02 13:52   ` bug#26339: [PATCH 10/18] system: Rename kernel->grub-label to kernel->boot-label Mathieu Othacehe
2017-04-15 10:40     ` Danny Milosavljevic
2017-04-02 13:52   ` bug#26339: [PATCH 11/18] bootloader: Add device and type to bootloader-configuration record Mathieu Othacehe
2017-04-02 13:52   ` bug#26339: [PATCH 12/18] system: Rename grub-device to fs->boot-device Mathieu Othacehe
2017-04-15 12:45     ` Danny Milosavljevic
2017-04-02 13:52   ` bug#26339: [PATCH 13/18] scripts: system: Remove unused variables Mathieu Othacehe
2017-04-02 13:52   ` bug#26339: [PATCH 14/18] scripts: system: Rename grub? and install-grub? to bootloader? and install-bootloader? Mathieu Othacehe
2017-04-15 13:25     ` Danny Milosavljevic
2017-04-02 13:52   ` bug#26339: [PATCH 15/18] scripts: system: Adapt "reconfigure" to new bootloader API Mathieu Othacehe
2017-04-02 13:52   ` bug#26339: [PATCH 16/18] scripts: system: Adapt "init" " Mathieu Othacehe
2017-04-02 13:52   ` bug#26339: [PATCH 17/18] scripts: system: Adapt "switch-generation" " Mathieu Othacehe
2017-04-15 16:47     ` Danny Milosavljevic
2017-04-15 17:27       ` Mathieu Othacehe
2017-05-05  7:13         ` Danny Milosavljevic
2017-05-05  7:21           ` Mathieu Othacehe
2017-04-15 18:17       ` problem with commit abae042 Mathieu Othacehe
2017-04-15 18:56         ` Danny Milosavljevic
2017-04-15 19:13           ` Mathieu Othacehe
2017-04-15 19:50         ` bootloader and kernel arguments "--root", "--system", "--load" Danny Milosavljevic
2017-04-15 23:18         ` bug#26339: problem with commit abae042 Leo Famulari
2017-04-15 23:22           ` Danny Milosavljevic
2017-04-15 23:56             ` Leo Famulari
2017-04-02 13:52   ` bug#26339: [PATCH 18/18] scripts: system: Display bootloader device and type in "list-generations" Mathieu Othacehe
2017-04-02 18:24   ` bug#26339: [PATCH 01/18] system: Pass <bootloader-parameter> to grub David Craven
2017-04-15 13:04   ` Danny Milosavljevic
2017-04-15 13:58   ` Danny Milosavljevic
2017-04-15 15:39     ` Danny Milosavljevic
2017-04-15 20:17   ` Danny Milosavljevic
2017-04-17  9:01 ` bug#26339: [PATCH v2 00/12] Support for non grub bootloaders Mathieu Othacehe
2017-04-17  9:01   ` bug#26339: [PATCH v2 01/12] system: Pass <bootloader-parameter> to grub Mathieu Othacehe
2017-04-17 17:08     ` Danny Milosavljevic
2017-05-08  9:37     ` Ludovic Courtès
2017-05-08 13:51       ` Danny Milosavljevic
2017-05-08 15:00         ` Mathieu Othacehe
2017-05-09 14:16           ` Marius Bakke
2017-05-09 14:36             ` Mathieu Othacehe
2017-05-08 19:47         ` Ludovic Courtès
2017-05-08 20:04           ` Danny Milosavljevic
2017-05-09  7:03             ` Ludovic Courtès
2017-05-09  7:21               ` Danny Milosavljevic
2017-05-09  9:45                 ` Ludovic Courtès
2017-05-08 20:16           ` bug#26339: [PATCH] system: Remove circular dependency between (gnu system) and (gnu system grub) Danny Milosavljevic
2017-05-08 21:01             ` Danny Milosavljevic
2017-05-08 14:53       ` bug#26339: [PATCH v2 01/12] system: Pass <bootloader-parameter> to grub Mathieu Othacehe
2017-04-17  9:01   ` bug#26339: [PATCH v2 02/12] system: Add extlinux support Mathieu Othacehe
2017-04-17  9:01   ` bug#26339: [PATCH v2 03/12] scripts: system: Rename --no-grub option to --no-bootloader Mathieu Othacehe
2017-04-17 15:54     ` Danny Milosavljevic
2017-04-17  9:01   ` bug#26339: [PATCH v2 04/12] bootloader: Add install procedures and use them Mathieu Othacehe
2017-04-17  9:01   ` bug#26339: [PATCH v2 05/12] system: Add bootloader type Mathieu Othacehe
2017-04-17  9:01   ` bug#26339: [PATCH v2 06/12] bootloader: Stop using grub module Mathieu Othacehe
2017-04-17  9:01   ` bug#26339: [PATCH v2 07/12] bootloader: Add device and type to bootloader-configuration record Mathieu Othacehe
2017-04-17  9:01   ` bug#26339: [PATCH v2 08/12] scripts: system: Remove unused variables Mathieu Othacehe
2017-04-17  9:01   ` bug#26339: [PATCH v2 09/12] scripts: system: Adapt "reconfigure" to new bootloader API Mathieu Othacehe
2017-04-17  9:01   ` bug#26339: [PATCH v2 10/12] scripts: system: Adapt "init" " Mathieu Othacehe
2017-04-23  8:39     ` Danny Milosavljevic
2017-04-23  8:53       ` Danny Milosavljevic
2017-04-23 16:38         ` Mathieu Othacehe
2017-04-23 16:34       ` Mathieu Othacehe
2017-04-17  9:01   ` bug#26339: [PATCH v2 11/12] scripts: system: Adapt "switch-generation" " Mathieu Othacehe
2017-04-17  9:01   ` bug#26339: [PATCH v2 12/12] scripts: system: Display bootloader device and type in "list-generations" Mathieu Othacehe
2017-05-06 15:41 ` bug#26339: [PATCH v3 0/9] Support non-grub bootloaders Mathieu Othacehe
2017-05-06 15:41   ` bug#26339: [PATCH v3 1/9] system: Add extlinux support Mathieu Othacehe
2017-05-07 16:41     ` Danny Milosavljevic
2017-05-07 20:01       ` Mathieu Othacehe
2017-05-06 15:41   ` bug#26339: [PATCH v3 2/9] bootloader: Add install procedures and use them Mathieu Othacehe
2017-05-07 16:52     ` Danny Milosavljevic
2017-05-06 15:41   ` bug#26339: [PATCH v3 3/9] system: Add bootloader type Mathieu Othacehe
2017-05-07 16:55     ` Danny Milosavljevic
2017-05-06 15:41   ` bug#26339: [PATCH v3 4/9] bootloader: Stop using grub module Mathieu Othacehe
2017-05-07 16:53     ` Danny Milosavljevic
2017-05-06 15:41   ` bug#26339: [PATCH v3 5/9] bootloader: Add device and type to bootloader-configuration record Mathieu Othacehe
2017-05-07 20:59     ` Danny Milosavljevic
2017-05-06 15:41   ` bug#26339: [PATCH v3 6/9] scripts: system: Adapt "reconfigure" to new bootloader API Mathieu Othacehe
2017-05-07 20:33     ` Danny Milosavljevic
2017-05-07 20:56       ` Danny Milosavljevic
2017-05-08 16:24         ` Mathieu Othacehe
2017-05-08 16:21       ` Mathieu Othacehe
2017-05-07 21:14     ` Danny Milosavljevic
2017-05-08 16:27       ` Mathieu Othacehe
2017-05-06 15:41   ` bug#26339: [PATCH v3 7/9] scripts: system: Adapt "init" " Mathieu Othacehe
2017-05-07 21:08     ` Danny Milosavljevic
2017-05-08 16:26       ` Mathieu Othacehe
2017-05-06 15:41   ` bug#26339: [PATCH v3 8/9] scripts: system: Adapt "switch-generation" " Mathieu Othacehe
2017-05-07 20:54     ` Danny Milosavljevic
2017-05-08 16:22       ` Mathieu Othacehe
2017-05-06 15:41   ` bug#26339: [PATCH v3 9/9] scripts: system: Display bootloader device and type in "list-generations" Mathieu Othacehe
2017-05-07 16:57     ` Danny Milosavljevic
2017-05-14  7:47 ` bug#26339: [PATCH v4 0/7] Support non grub bootloaders Mathieu Othacehe
2017-05-14  7:47   ` bug#26339: [PATCH v4 1/7] bootloader: Add extlinux support Mathieu Othacehe
2017-05-14  8:43     ` Danny Milosavljevic
2017-05-16 12:46       ` Mathieu Othacehe
2017-05-14 13:25     ` Ludovic Courtès
2017-05-16 12:51       ` Mathieu Othacehe
2017-05-16 14:38         ` Danny Milosavljevic
2017-05-16 14:50           ` Mathieu Othacehe
2017-05-16 15:00             ` Danny Milosavljevic
2017-05-16 15:03               ` Mathieu Othacehe
2017-05-14 13:35     ` Ludovic Courtès
2017-05-16 12:55       ` Mathieu Othacehe
2017-05-14  7:47   ` bug#26339: [PATCH v4 2/7] bootloader: Adapt vm to new bootloader API Mathieu Othacehe
2017-05-14  8:47     ` Danny Milosavljevic
2017-05-14 13:28     ` Ludovic Courtès
2017-05-14 14:59       ` Danny Milosavljevic
2017-05-14 19:53         ` Ludovic Courtès
2017-05-14  7:47   ` bug#26339: [PATCH v4 3/7] bootloader: Add bootloader name to boot-parameters record Mathieu Othacehe
2017-05-14  8:47     ` Danny Milosavljevic
2017-05-14 13:29       ` Ludovic Courtès
2017-05-14  7:48   ` bug#26339: [PATCH v4 4/7] scripts: system: Adapt "reconfigure" to new bootloader API Mathieu Othacehe
2017-05-14  8:50     ` Danny Milosavljevic
2017-05-14 13:31     ` Ludovic Courtès
2017-05-14  7:48   ` bug#26339: [PATCH v4 5/7] scripts: system: Adapt "init" " Mathieu Othacehe
2017-05-14  8:51     ` Danny Milosavljevic
2017-05-14 13:31       ` Ludovic Courtès
2017-05-14  7:48   ` bug#26339: [PATCH v4 6/7] scripts: system: Adapt "switch-generation" " Mathieu Othacehe
2017-05-14  8:52     ` Danny Milosavljevic
2017-05-14 13:32       ` Ludovic Courtès
2017-05-14  8:54     ` Danny Milosavljevic
2017-05-16 12:46       ` Mathieu Othacehe
2017-05-14  7:48   ` bug#26339: [PATCH v4 7/7] scripts: system: Display bootloader name in "list-generations" Mathieu Othacehe
2017-05-14 13:33     ` Ludovic Courtès
2017-05-16 13:03 ` bug#26339: [PATCH] doc: Adapt to multiple bootloader support Mathieu Othacehe
2017-05-20 20:49   ` Danny Milosavljevic
2017-05-22  8:11     ` Mathieu Othacehe
2017-05-20 21:12   ` Tomáš Čech
2017-05-20 21:19     ` Mathieu Othacehe
2017-05-18 10:13 ` bug#26339: [PATCH] bootloader: extlinux: Add extlinux-bootloader-gpt Mathieu Othacehe
2017-06-12 20:23   ` [bug#26339] " Ludovic Courtès
2017-06-13 17:52     ` Mathieu Othacehe
2017-06-14  7:37       ` Ludovic Courtès
2017-06-13 14:34   ` Danny Milosavljevic
2017-05-18 10:26 ` bug#26339: [PATCH] tests: Add syslinux gpt test Mathieu Othacehe
2017-06-12 20:29   ` [bug#26339] " Ludovic Courtès
2017-06-19 16:55     ` Mathieu Othacehe
2017-06-20 20:13       ` Ludovic Courtès
2017-06-21  8:05         ` Mathieu Othacehe
2017-05-21 13:57 ` bug#26339: [PATCH] scripts: system: Handle unspecified bootloader package and installer Mathieu Othacehe
2017-06-12 20:32   ` [bug#26339] " Ludovic Courtès
2017-06-10  8:53 ` bug#26339: [PATCH] bootloader: Rename boot-name to bootloader-name Mathieu Othacehe
2017-06-10 14:26   ` Ludovic Courtès
2017-06-10 16:33     ` Mathieu Othacehe
2017-06-11  8:42     ` Mathieu Othacehe
2017-06-11  9:54       ` bug#26339: "extlinux", "extlinux" gpt, bootloader-configuration without package nor installer Danny Milosavljevic
2017-06-11 10:13         ` Danny Milosavljevic
2017-06-12  9:58         ` [bug#26339] " Mathieu Othacehe
2017-06-12 20:09           ` Ludovic Courtès
2017-06-12 20:20         ` Ludovic Courtès
2017-06-13  5:07           ` Danny Milosavljevic
2017-10-04 14:55             ` Ludovic Courtès
2017-10-04 19:56               ` Mathieu Othacehe
2017-10-13 14:08 ` bug#26339: closing bootloader serie Mathieu Othacehe
2017-10-13 15:31   ` [bug#26339] " Ludovic Courtès
2017-10-26  9:43     ` Mathieu Othacehe
2017-10-26 17:14       ` Ludovic Courtès
2017-10-26 17:33         ` Mathieu Othacehe
2017-10-26 22:20           ` Ludovic Courtès
2017-10-27  7:52             ` bug#26339: " Mathieu Othacehe
2017-10-29 15:47               ` Ludovic Courtès
2017-11-09 10:47                 ` GuixSD on armhf Mathieu Othacehe
2017-11-10 23:39                   ` Chris Marusich
2017-11-11 11:35                   ` Ludovic Courtès

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=87mvanjepx.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=26339@debbugs.gnu.org \
    --cc=david@craven.ch \
    --cc=m.othacehe@gmail.com \
    /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.