From: Daan De Meyer Date: Fri, 18 Aug 2023 11:23:52 +0000 (+0200) Subject: Add none Bootloader option X-Git-Tag: v16~52^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbabc572b19a0a86c48d6901e0008c439c4ddfcf;p=thirdparty%2Fmkosi.git Add none Bootloader option This disables adding any EFI bootloader altogether. Preparation for adding BIOS support. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 497033b23..3dc1cd671 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -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): diff --git a/mkosi/config.py b/mkosi/config.py index 37bd235c4..5c13d11ea 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -116,6 +116,7 @@ class DocFormat(StrEnum): class Bootloader(StrEnum): + none = enum.auto() uki = enum.auto() systemd_boot = enum.auto() diff --git a/mkosi/resources/mkosi.md b/mkosi/resources/mkosi.md index 29d08cc06..2d9706310 100644 --- a/mkosi/resources/mkosi.md +++ b/mkosi/resources/mkosi.md @@ -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`