[systemd-devel] automount EFI system partition to /efi fails

Lennart Poettering lennart at poettering.net
Thu Apr 26 11:23:43 UTC 2018


On Mi, 25.04.18 13:24, Chris Murphy (lists at colorremedies.com) wrote:

> What happens if /efi does not yet exist? I created it normally 'sudo
> mkdir /efi' before modifying /etc/fstab to comment out /boot/efi
> line.

Nothing. The generator that establishes this automount point becomes a
NOP unless:

  1. /efi exists
  2. /efi is empty
  3. There's no mount listed for it in /etc/fstab

Hence, if you want to make use of the automatic ESP mounting logic,
then simply create /etc and all should be good.

> So far as I know, installers don't create /efi (Fedora's installer
> does not) so that would be a needed feature. And then also things that
> modify /boot/efi need to be modified to use /efi instead. Some of this
> is abstracted with symlinks, e.g. Fedora uses symlink grub2-efi.cfg ->
> ../boot/efi/EFI/fedora/grub.cfg which is how grubby modifies it, but
> that can be changed to grub2-efi.cfg -> ../efi/EFI/fedora/grub.cfg -
> the bigger change is with the bootloader binaries needing updating,
> those packages have to know to look at both locations for the
> foreseeable future. Not too difficult, just a matter of doing it.

The automatic /efi magic is an offer to distributions, that allows
them to remove any kind of mount setup during distro install, and
exposes exceptionally safe access to the ESP (because it is umounted
shortly after every access though still appears mounted
continously). However, it's really just that: an offer. Fedora doesn't
use that by default last time I looked, though I wish it would. I
guess this needs a champion who pushes this through the fedora changes
bureaucracy.

I'd recommend Fedora to create /efi at boot, and then maintain a
compat symlink /boot/efi → ../efi to maintain compatibility with the
status quo ante. 

If fedora were to make that change, I figure some RPM postinst script
would have to rearrange things roughly like this:

```sh
sed -i -e '/\/boot\/efi/d' /etc/fstab
mkdir /efi
umount /boot/efi
rmdir /boot/efi
ln -s ../efi /boot/efi
```

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list