On Wed, 6 Dec 2023 at 15:32, Peter Humphreey <pe...@prh.myzen.co.uk> wrote:
>
> I want to use bootctl from systemd-boot, as usual, to give me a
> boot menu without that grub monster.
>
As a disclaimer, I do not and have not used systemd-boot specifically.
That said...

> In particular, the Gentoo wiki says I must have an EFI partition of type esp
> [1] - not a directory in, say, /boot, as my other machines have. All right so
> far, but the Gentoo systemd-boot page says I need a /boot partition as well,
> of type XBOOTLDR [2]. So now I seem to need /efi on /dev/nvme0n1p1 and /boot 
> on
> /dev/nvme0n1p2, both with FAT32 file systems.
>
This is indeed my understanding as well.

Irrespective of systemd-boot ESP is required for EFI bootloader
executables to be stored into. This is part of the GPT and UEFI
standard, so this should be of type ESP and formatted as FAT32, and is
usually the first partition on the boot drive when using GPT. Not
required for BIOS/Legacy boot, as the guide already mentions.

Moving on to "/boot", it has long been recommended (but not always
required) to have "/boot" as a separate partition. In practice, it
would often be the case (especially with GRUB) that "/boot" could
simply be a directory on your root partition. But sometimes, e.g. with
LVM and/or encrypted root, "/boot" has to be separated out so that the
kernel image could be read and booted by the boot loader before rootfs
could be unlocked. This could be any filesystem recognised by the boot
loader of choice.

So, a typical GPT set up, especially when having encrypted rootfs,
would look something like:

/dev/nvme0n1p1: ESP, GPT type 0xEF00, FAT32, usually mounted under
/efi (preferred) or /boot/efi (legacy)
/dev/nvme0n1p2: boot, GPT type 0x8300, ext3/ext4/etc, usually mounted
under /boot
/dev/nvme0n1p3: rootfs - GPT type 0x8308 if using LUKS, 0x8300 for
standard rootfs

So, without knowing much about systemd-boot from the guide linked it
seems to me that its implementation doesn't differ too much from this
reasonably well established model, except for a few additional
constraints which, based on my understanding, are:
1. You _must_ have an XBOOTLDR partition (functionally equivalent to
"boot" above) _in addition to_ the ESP and cannot simply use "/boot"
under your rootfs partition
2. XBOOTLDR partition _must_ be of GPT type 0xEA00
3. XBOOTLDR partition _must_ have GUID set to
"bc13c2ff-59e6-4262-a352-b275fd6f7172"
4. XBOOTLDR partition _must_ be formatted with a filesystem supported
by your EFI BIOS with FAT32 being universally supported, though your
particular EFI BIOS _might_ support others

I say "must" as it appears to be from the guide like this is the
requirement for systemd-boot, the actual Boot Loader Specification
page appears to suggest that an XBOOTLDR partition is optional. So
there may be a viable configuration without it.

Mount point recommendations seem consistent with previously
established conventions re EFI ESP and /boot.

Hope this helps. I'm happy to be corrected in case I misunderstood
anything specific to systemd-boot.

Best Regards,
Victor

Reply via email to