gpt-generator, bootctl, nspawn: EFI mount point handling updates by poettering · Pull Request #3757 · systemd/systemd

Let's make the EFI generator a bit smarter: if /efi exists it is used as mount
point for the ESP, otherwise /boot is used. This should increase compatibility
with distros which use legacy boot loaders that insist on having /boot as
something that isn't the ESP.
…o /efi or /boot

Matching the behaviour of gpt-auto-generator, if we find an ESP while
dissecting a container image, mount it to /efi or /boot if those dirs exist and
are empty.

This should enable us to run "bootctl" inside a container and do the right
thing.

@poettering

@poettering

… path

This rearranges bootctl a bit, so that it uses the usual verbs parsing
routines, and automatically searches the ESP in /boot, /efi or /boot/efi, thus
increasing compatibility with mainstream distros that insist on /boot/efi.

This also adds minimal support for running bootctl in a container environment:
when run inside a container verification of the ESP via raw block device
access, trusting the container manager to mount the ESP correctly. Moreover,
EFI variables are not accessed when running in the container.

@poettering

@poettering

@poettering

We already have tolower() calls there, hence let's unify this at one place.
Also, update the code to only use ASCII operations, so that we don't end up
being locale dependant.
After all, the field is kinda borked.
Make sure that we always initialize the return parameter on success, and that
all errors result in an error message, not just some.

@poettering

let's the proper APIs to read the machine ID, and properly check for all
errors.
…/efi

With this change kernel-install will now first look for an existing kernel
installation in /efi, /boot and /boot/efi. If none is found, /efi is used if it
is a mount point, otherwise /boot/efi if it is one. If nothing of that worked
/boot is used without further checking.

This means /boot should be the default unless something was installed before or
something else was explicitly mounted.
Previously, we'd not mount the ESP except on EFI boots, and only when the ESP
used for booting matches the ESP we found.

With this change on non-EFI boots we'll mount a discovered ESP anyway, and on
EFI boots we'll only mount it if it matches the ESP we booted from.

keszybz added a commit to keszybz/systemd that referenced this pull request

Jul 25, 2016

keszybz added a commit that referenced this pull request

Jul 25, 2016

ids1024 pushed a commit to pop-os/system76-firmware that referenced this pull request

Sep 27, 2020

@t3hmrman

@kojq kojq mentioned this pull request

Feb 23, 2023