all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Marius Bakke <mbakke@fastmail.com>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: UEFI support in boot image
Date: Wed, 19 Apr 2017 22:26:21 +0200	[thread overview]
Message-ID: <87vaq0m9ea.fsf@gnu.org> (raw)
In-Reply-To: <8760i2lqbf.fsf@fastmail.com> (Marius Bakke's message of "Mon, 17 Apr 2017 22:41:40 +0200")

Hi Marius!

Marius Bakke <mbakke@fastmail.com> skribis:

> I've attached a few patches as a humble beginning, but currently the
> "format-partition" code in (gnu build vm) needs to learn some
> filesystem-specific parameters. So, I don't think it will be ready for
> the upcoming release.
>
> I have also done some reading and don't think we can use isolinux as it
> requires an image in ISO 9660 format. Nor does the syslinux utilities
> actually support chainloading grub from UEFI as I had hoped.

OK.

> So I think we'll have to offer UEFI as a standalone image, at least to
> begin with. Unfortunately I also believe it needs to be generated from a
> UEFI system, but this grub limitation can hopefully be lifted.

Providing a separate standalone image is reasonable IMO.

Anyway, I’m happy to see this patch set!

> From 25b01f9a219338580b6f7a7449bba8ff90c2176c Mon Sep 17 00:00:00 2001
> From: Marius Bakke <mbakke@fastmail.com>
> Date: Tue, 11 Apr 2017 10:47:38 +0200
> Subject: [PATCH 1/4] vm: Add support for arbitrary partition flags.
>
> * gnu/build/vm.scm (<partition>): Change BOOTABLE? to FLAGS.
> (initialize-partition-table): Pass each flag to parted.
> (initialize-hard-disk): Search for root partition by "boot" flag.
> * gnu/system/vm.scm (qemu-image): Adjust partitions accordingly.

[...]

> @@ -141,7 +141,7 @@ the #:references-graphs parameter of 'derivation'."
>    (size        partition-size)
>    (file-system partition-file-system (default "ext4"))
>    (label       partition-label (default #f))
> -  (bootable?   partition-bootable? (default #f))
> +  (flags       partition-flags (default '()))
>    (initializer partition-initializer (default (const #t))))

So ‘flags’ must be a list of strings, and each string is something
Parted recognizes, right?

It would be slightly nicer to make it a list of symbols.

> +  (define (find-root-partition partitions)
> +    "Return the first partition found with the boot flag set."
> +    ;; FIXME: This probably does not work. What's the best way to do this?
> +    (find (match-lambda
> +            (($ <partition> _ _ _ _ flags)
> +             (member "boot" flags)))
> +          partitions))

Why wouldn’t it work?  LGTM.

BTW, in this case, I’d recommend using ‘partition-flags’ instead of
‘match’ with the 4 wildcards; probably safer.  :-)

That said, it’s probably best to keep

  (define (partition-bootable? partition)
    (member "boot" (partition-flags partition)))

>    (let* ((partitions (initialize-partition-table device partitions))
> -         (root       (find partition-bootable? partitions))
> +         (root       (find-root-partition partitions))

… and keep this line unchanged (‘find-foo’ procedures are an
anti-pattern in a way.)

> From 9db90ea41a94ecbe42bba88de1c2e3ac607d5ea4 Mon Sep 17 00:00:00 2001
> From: Marius Bakke <mbakke@fastmail.com>
> Date: Tue, 11 Apr 2017 10:55:22 +0200
> Subject: [PATCH 2/4] vm: Unconditionally add a small ESP partition.
>
> * gnu/system/vm.scm (qemu-image): Append 20MB FAT32 partition.

[...]

>                    (partitions (list (partition
>                                       (size #$(- disk-image-size
> -                                                (* 10 (expt 2 20))))
> +                                                (* 30 (expt 2 20))))
>                                       (label #$file-system-label)
>                                       (file-system #$file-system-type)
>                                       (flags '("boot"))
> -                                     (initializer initialize)))))
> +                                     (initializer initialize))
> +                                    (partition
> +                                     ;; Append a small FAT32 partition for
> +                                     ;; use with UEFI bootloaders.
> +                                     (size (* 20 (expt 2 20)))
> +                                     (label "gnu-esp")
> +                                     (file-system "vfat")
> +                                     (flags '("esp"))))))

Should we do it conditionally, only when targeting UEFI?

(BTW, what’s “esp”?)

> From 4306bae25d6110ec52b8bbe3ad8b55f2c4c18fca Mon Sep 17 00:00:00 2001
> From: Marius Bakke <mbakke@fastmail.com>
> Date: Mon, 17 Apr 2017 22:21:28 +0200
> Subject: [PATCH 3/4] gnu: dosfstools: Enable compatibility symlinks.
>
> * gnu/packages/disk.scm (dosfstools)[arguments]<#:configure-flags>: New
> parameter.

LGTM.

> From d3e733739edebfd42efd70e7cc6335f3862f1ed5 Mon Sep 17 00:00:00 2001
> From: Marius Bakke <mbakke@fastmail.com>
> Date: Mon, 17 Apr 2017 22:25:43 +0200
> Subject: [PATCH 4/4] gnu: vm: Add FAT32 utilities in base image.
>
> * gnu/system/vm.scm (qemu-image): Add DOSFSTOOLS to the closure.

OK.

Thank you for working on it!

Ludo’.

  reply	other threads:[~2017-04-19 20:26 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30 12:37 Planning for the next release Ludovic Courtès
2017-03-31 13:57 ` ng0
2017-03-31 16:25   ` Ludovic Courtès
2017-03-31 16:33     ` ng0
2017-03-31 23:07       ` Leo Famulari
2017-04-01  7:24         ` ng0
2017-04-04 10:39           ` Ricardo Wurmus
2017-05-20  8:40             ` Ludovic Courtès
2017-05-20 10:51               ` Ricardo Wurmus
2017-05-20 12:15                 ` Ludovic Courtès
2017-05-20 21:45                   ` Ricardo Wurmus
2017-05-20 22:29                     ` Ludovic Courtès
2017-05-20 15:14               ` Ludovic Courtès
2017-05-20 19:40                 ` Marius Bakke
2017-05-20 21:40                   ` Marius Bakke
2017-05-20 22:32                   ` Ludovic Courtès
2017-05-20 23:18                     ` Ludovic Courtès
2017-05-20 21:42               ` Ricardo Wurmus
2017-04-02 22:13 ` Marius Bakke
2017-04-03  8:23   ` Ludovic Courtès
2017-04-17 20:41     ` UEFI support in boot image Marius Bakke
2017-04-19 20:26       ` Ludovic Courtès [this message]
2017-04-19 21:43         ` Marius Bakke
2017-05-05 20:54           ` Ludovic Courtès
2017-05-06 14:49             ` Marius Bakke
2017-05-07 14:42               ` Marius Bakke
2017-04-03  0:28 ` Planning for the next release Leo Famulari
2017-04-03  8:26   ` Ludovic Courtès
2017-04-03 17:52     ` Leo Famulari
2017-04-04 11:56       ` Ludovic Courtès
2017-04-21 22:27 ` Ludovic Courtès
2017-04-21 22:33   ` Leo Famulari
2017-04-27 12:40     ` Ricardo Wurmus
2017-05-11  9:00 ` Ludovic Courtès
2017-05-12  5:45   ` Ricardo Wurmus
2017-05-12 12:13     ` Hartmut Goebel
2017-05-12 15:25     ` Ludovic Courtès
2017-05-12 18:50       ` Ricardo Wurmus
     [not found]     ` <CAFtzXzMOGmQ6PKxarkmAKENR0EkWsfVoN7qdUjsnvZ6fgrAdTA@mail.gmail.com>
     [not found]       ` <CAFtzXzO7+7nO0XF0xDWktoApobNwVyHSg_1q6Z2hmeLc6czf4w@mail.gmail.com>
     [not found]         ` <CAFtzXzMBqiHBhusVx651nm1xH+XvacLKeuDDZ-iaMzx7FawyhA@mail.gmail.com>
2017-05-12 18:18           ` Fwd: " Manolis Ragkousis
2017-05-13  7:06             ` Ricardo Wurmus
2017-05-12 18:04   ` Leo Famulari
2017-05-12 21:04     ` ng0
2017-05-13 13:59     ` Ludovic Courtès
2017-05-13 14:20       ` Vincent Legoll
2017-05-14 19:14       ` Leo Famulari
2017-05-14 20:19         ` Leo Famulari
2017-05-15  1:52         ` Leo Famulari
2017-05-15 12:44         ` Ludovic Courtès
2017-05-16 14:41           ` sirgazil
2017-05-16 18:17             ` Leo Famulari
2017-05-16 18:19             ` Leo Famulari
2017-05-17  0:51               ` sirgazil
2017-05-17  3:02                 ` Leo Famulari
2017-05-17  8:29                   ` Ludovic Courtès
2017-05-16 17:12           ` Alex Kost
2017-05-16 23:03           ` Leo Famulari
2017-05-17 12:38             ` Ludovic Courtès
2017-05-17 18:20               ` Leo Famulari
2017-05-22 11:49                 ` Building the web site Ludovic Courtès
2017-05-21 13:04       ` Planning for the next release Ricardo Wurmus

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=87vaq0m9ea.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=mbakke@fastmail.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.