From: Daan De Meyer Date: Sat, 14 Sep 2024 20:29:54 +0000 (+0200) Subject: Add some checks to check_inputs() for secure boot key and certificate X-Git-Tag: v25~295^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3030%2Fhead;p=thirdparty%2Fmkosi.git Add some checks to check_inputs() for secure boot key and certificate --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 0a47497cd..f00f89e55 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -2151,6 +2151,14 @@ def check_inputs(config: Config) -> None: if not os.access(script, os.X_OK): die(f"{script} is not executable") + if config.secure_boot and not config.secure_boot_key: + die("SecureBoot= is enabled but no secure boot key is configured", + hint="Run mkosi genkey to generate a secure boot key/certificate pair") + + if config.secure_boot and not config.secure_boot_certificate: + die("SecureBoot= is enabled but no secure boot key is configured", + hint="Run mkosi genkey to generate a secure boot key/certificate pair") + def check_tool(config: Config, *tools: PathString, reason: str, hint: Optional[str] = None) -> Path: tool = config.find_binary(*tools)