From: Daan De Meyer Date: Thu, 10 Aug 2023 09:54:25 +0000 (+0200) Subject: Don't try to tun timedatectl or ssh-add if not available X-Git-Tag: v15.1~5^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05e376e7974449f1bae88edc6c62e38070afb5ae;p=thirdparty%2Fmkosi.git Don't try to tun timedatectl or ssh-add if not available --- diff --git a/mkosi/config.py b/mkosi/config.py index 8d4fbe856..529ffa520 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -1938,7 +1938,7 @@ def load_credentials(args: argparse.Namespace) -> dict[str, str]: key, _, value = s.partition("=") creds[key] = value - if "firstboot.timezone" not in creds: + if "firstboot.timezone" not in creds and shutil.which("timedatectl"): tz = run( ["timedatectl", "show", "-p", "Timezone", "--value"], stdout=subprocess.PIPE, @@ -1950,7 +1950,7 @@ def load_credentials(args: argparse.Namespace) -> dict[str, str]: if "firstboot.locale" not in creds: creds["firstboot.locale"] = "C.UTF-8" - if args.ssh and "ssh.authorized_keys.root" not in creds and "SSH_AUTH_SOCK" in os.environ: + if args.ssh and "ssh.authorized_keys.root" not in creds and "SSH_AUTH_SOCK" in os.environ and shutil.which("ssh-add"): key = run( ["ssh-add", "-L"], stdout=subprocess.PIPE,