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 #562
  • Loading branch information
Werkov authored and DaanDeMeyer committed Jan 22, 2021
1 parent 5e8fa08 commit 092b12d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mkosi/__init__.py
Expand Up @@ -1419,6 +1419,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 092b12d

Please sign in to comment.