Skip to content

Commit

Permalink
UEFI boot: make sure efivarfs loaded in initrd
Browse files Browse the repository at this point in the history
The efivarfs is needed in order to GPT root partition discovery work.
Without efivarfs initrd won't be able to switch to the real root.

Add the module regardless of hostonly or distro configuration because
dracut takes into account info from the build host and not the target
distro. Adding a module that's already included in dracut's list makes
no harm.

Fixes systemd#562
  • Loading branch information
Werkov committed Jan 22, 2021
1 parent 8d4229e commit b3c3927
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mkosi/__init__.py
Expand Up @@ -1416,6 +1416,10 @@ def configure_dracut(args: CommandLineArguments, root: str) -> None:
):
with open(os.path.join(dracut_dir, "30-mkosi-uefi-stub.conf"), "w") as f:
f.write("uefi_stub=/usr/lib/systemd/boot/efi/linuxx64.efi.stub\n")

# efivarfs must be present in order to GPT root discovery work
if args.esp_partno is not None:
with open(os.path.join(dracut_dir, "30-mkosi-efivarfs.conf"), "w") as f:
f.write('add_drivers+=" efivarfs "\n')


Expand Down

0 comments on commit b3c3927

Please sign in to comment.