From 092b12d6caccf8beeda865774a625f5a22939ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Koutn=C3=BD?= Date: Thu, 21 Jan 2021 18:52:43 +0100 Subject: [PATCH] UEFI boot: make sure efivarfs loaded in initrd 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 --- mkosi/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 0006a970d..c3886cbf7 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -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')