def find_passphrase(args: argparse.Namespace) -> None:
- if args.encrypt is None:
+ if not needs_build(args) or args.encrypt is None:
args.passphrase = None
return
def find_password(args: argparse.Namespace) -> None:
- if args.password is not None:
+ if not needs_build(args) or args.password is not None:
return
try:
find_extra(args)
find_skeleton(args)
- find_password(args)
- find_passphrase(args)
find_secure_boot(args)
find_image_version(args)
"UEFI SecureBoot or signed Verity enabled, but couldn't find certificate. (Consider placing it in mkosi.secure-boot.crt?)"
) # NOQA: E501
+ # Resolve passwords late so we can accurately determine whether a build is needed
+ find_password(args)
+ find_passphrase(args)
+
if args.verb in (Verb.shell, Verb.boot):
opname = "acquire shell" if args.verb == Verb.shell else "boot"
if args.output_format in (OutputFormat.tar, OutputFormat.cpio):