]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Make ESP logic bootloader independent
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 21 Aug 2023 10:13:04 +0000 (12:13 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 21 Aug 2023 10:18:55 +0000 (12:18 +0200)
Let's simply check if a bootloader was placed in the right location
instead of having systemd-boot specific checks.

mkosi/__init__.py

index 3dc1cd671b7e4239bcee5893cc8b0761e5385b97..fb4b6101391b52e5be2d40ee5fa8b08233cc0ab6 100644 (file)
@@ -1374,14 +1374,10 @@ def make_image(state: MkosiState, skip: Sequence[str] = [], split: bool = False)
         definitions = state.workspace / "repart-definitions"
         if not definitions.exists():
             definitions.mkdir()
-            bootdir = state.root / "usr/lib/systemd/boot/efi"
+            bootloader = state.root / f"efi/EFI/BOOT/BOOT{state.config.architecture.to_efi()}.EFI"
 
-            # If Bootable=auto and we have at least one UKI and a bootloader, let's generate an ESP partition.
             add = (state.config.bootable == ConfigFeature.enabled or
-                  (state.config.bootable == ConfigFeature.auto and
-                   bootdir.exists() and
-                   any(bootdir.iterdir()) and
-                   any(gen_kernel_images(state))))
+                  (state.config.bootable == ConfigFeature.auto and bootloader.exists()))
 
             if add:
                 (definitions / "00-esp.conf").write_text(