From: Marius Bakke <mbakke@fastmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: UEFI support in boot image
Date: Wed, 19 Apr 2017 23:43:20 +0200 [thread overview]
Message-ID: <87inm0t6o7.fsf@fastmail.com> (raw)
In-Reply-To: <87vaq0m9ea.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 3657 bytes --]
Ludovic Courtès <ludo@gnu.org> writes:
>> @@ -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?
Correct.
> It would be slightly nicer to make it a list of symbols.
Good idea.
>> + (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.)
That's much better indeed. Thanks!
>> 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?
Probably, but I'm not sure which condition (maybe 'uefi-disk-image'?).
Will revisit this once it works :)
> (BTW, what’s “esp”?)
ESP is short for 'EFI System Partition' (I'll mention this in the code
somewhere). UEFI firmwares scans each connected I/O device looking for
this partition, which must be flagged as such and FAT-formatted.
Thanks for the feedback! I'll keep hammering at this and should
hopefully have something usable within a few weeks. Currently, need to
figure out why the qemu builder can't find the ISO8859-1 kernel module.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
next prev parent reply other threads:[~2017-04-19 21:43 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
2017-04-19 21:43 ` Marius Bakke [this message]
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87inm0t6o7.fsf@fastmail.com \
--to=mbakke@fastmail.com \
--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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).