From: Daan De Meyer Date: Sat, 6 May 2023 09:55:48 +0000 (+0200) Subject: Only check if given initrds exist if we're building a bootable image X-Git-Tag: v15~177^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5aa078511b6acb7171db0730676e933bb4dbc9ad;p=thirdparty%2Fmkosi.git Only check if given initrds exist if we're building a bootable image This allows disabling the initrd build without failing the final image build that uses it. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 74b643f1d..84eec5a0a 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -1132,11 +1132,12 @@ def check_inputs(config: MkosiConfig) -> None: config.finalize_script): check_script_input(path) - for p in config.initrds: - if not p.exists(): - die(f"Initrd {p} not found") - if not p.is_file(): - die(f"Initrd {p} is not a file") + if config.bootable != ConfigFeature.disabled: + for p in config.initrds: + if not p.exists(): + die(f"Initrd {p} not found") + if not p.is_file(): + die(f"Initrd {p} is not a file") except OSError as e: die(f'{e.filename}: {e.strerror}')