]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Add none Bootloader option
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 18 Aug 2023 11:23:52 +0000 (13:23 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 18 Aug 2023 19:12:27 +0000 (21:12 +0200)
This disables adding any EFI bootloader altogether. Preparation
for adding BIOS support.

mkosi/__init__.py
mkosi/config.py
mkosi/resources/mkosi.md

index 497033b230c5ad2ddd5438cdc2bbcfc55cbd3d64..3dc1cd671b7e4239bcee5893cc8b0761e5385b97 100644 (file)
@@ -471,13 +471,13 @@ def install_systemd_boot(state: MkosiState) -> None:
 
     if not shutil.which("bootctl"):
         if state.config.bootable == ConfigFeature.enabled:
-            die("A bootable image was requested but bootctl was not found")
+            die("An EFI bootable image with systemd-boot was requested but bootctl was not found")
         return
 
     directory = state.root / "usr/lib/systemd/boot/efi"
     if not directory.exists() or not any(directory.iterdir()):
         if state.config.bootable == ConfigFeature.enabled:
-            die("A bootable image was requested but systemd-boot was not found at "
+            die("A EFI bootable image with systemd-boot was requested but systemd-boot was not found at "
                 f"{directory.relative_to(state.root)}")
         return
 
@@ -725,7 +725,7 @@ def install_unified_kernel(state: MkosiState, partitions: Sequence[Partition]) -
     if state.config.bootable == ConfigFeature.disabled:
         return
 
-    if state.config.bootloader not in (Bootloader.systemd_boot, Bootloader.uki):
+    if state.config.bootloader == Bootloader.none:
         return
 
     for kver, kimg in gen_kernel_images(state):
index 37bd235c4f64b12e82356e1337314ffc94969e3e..5c13d11ea88fb6c54f11e156e0e30dd94c44fd67 100644 (file)
@@ -116,6 +116,7 @@ class DocFormat(StrEnum):
 
 
 class Bootloader(StrEnum):
+    none         = enum.auto()
     uki          = enum.auto()
     systemd_boot = enum.auto()
 
index 29d08cc0648ab6209cc6eb9ba07d023a64349bde..2d9706310259c0c685fada866918edb7c12d101e 100644 (file)
@@ -771,24 +771,25 @@ they should be specified with a boolean argument: either "1", "yes", or "true" t
 `Bootable=`, `--bootable=`
 
 : Takes a boolean or `auto`. Enables or disables generation of a
-  bootable image. If enabled, mkosi will install systemd-boot, and add
-  an ESP partition when the disk image output is used. If systemd-boot
-  is not installed or no kernel images can be found, the build will
-  fail. `auto` behaves as if the option was enabled, but the build won't
-  fail if either no kernel images or systemd-boot can't be found. If
-  disabled, systemd-boot won't be installed even if found inside the
-  image, no unified kernel images will be generated and no ESP partition
-  will be added to the image if the disk output format is used.
+  bootable image. If enabled, mkosi will install an EFI bootloader, and
+  add an ESP partition when the disk image output is used. If the
+  selected EFI bootloader (See `Bootloader=`) is not installed or no
+  kernel images can be found, the build will fail. `auto` behaves as if
+  the option was enabled, but the build won't fail if either no kernel
+  images or the selected EFI bootloader can't be found. If disabled, no
+  bootloader will be installed even if found inside the image, no
+  unified kernel images will be generated and no ESP partition will be
+  added to the image if the disk output format is used.
 
 `Bootloader=`, `--bootloader=`
 
-: Takes one of `systemd-boot` or `uki`. Defaults to `systemd-boot`. If
-  set to `systemd-boot`, systemd-boot will be installed and for each
-  installed kernel, a UKI will be generated and stored in `EFI/Linux` in
-  the ESP partition. If set to `uki`, systemd-boot will not be installed
-  and a single UKI will be generated for the latest installed kernel
-  (the one with the highest version) and stored in
-  `EFI/BOOT/BOOTX64.EFI`.
+: Takes one of `none`, `systemd-boot` or `uki`. Defaults to
+  `systemd-boot`. If set to `none`, no EFI bootloader will be installed
+  into the image. If set to `systemd-boot`, systemd-boot will be
+  installed and for each installed kernel, a UKI will be generated and
+  stored in `EFI/Linux` in the ESP. If set to `uki`, a single UKI will
+  be generated for the latest installed kernel (the one with the highest
+  version) which is installed to `EFI/BOOT/BOOTX64.EFI` in the ESP.
 
 `Initrds=`, `--initrd`