From: Daan De Meyer Date: Fri, 12 May 2023 08:40:03 +0000 (+0200) Subject: Don't install a boot loader if no kernels are installed X-Git-Tag: v15~161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68f60b62cdf382e00be56cbefdbf2c42042a58e1;p=thirdparty%2Fmkosi.git Don't install a boot loader if no kernels are installed If a bootable image has not been explicitly requested, don't install a boot loader if we can't find any kernel images installed in the image. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 946c6903c..d45251859 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -377,6 +377,9 @@ def install_boot_loader(state: MkosiState) -> None: if state.config.output_format == OutputFormat.cpio and state.config.bootable == ConfigFeature.auto: return + if not any(gen_kernel_images(state)) and state.config.bootable == ConfigFeature.auto: + return + directory = state.root / "usr/lib/systemd/boot/efi" if not directory.exists() or not any(directory.iterdir()): if state.config.bootable == ConfigFeature.enabled: