return setfiles, policy, fc, binpolicy
+def swtpm_setup_version(sandbox: SandboxProtocol = nosandbox) -> GenericVersion:
+ version = GenericVersion(
+ run(
+ ["swtpm_setup", "--version"],
+ stdout=subprocess.PIPE,
+ sandbox=sandbox(),
+ success_exit_status=(0, 1),
+ ).stdout.split()[-1]
+ )
+
+ logging.debug(f"Version reported by swtpm_setup is {version}")
+
+ return version
+
+
def systemd_tool_version(*tool: PathString, sandbox: SandboxProtocol = nosandbox) -> GenericVersion:
version = GenericVersion(
run(
VsockCID,
finalize_term,
format_bytes,
+ swtpm_setup_version,
systemd_pty_forward,
systemd_tool_version,
want_selinux_relabel,
"--pcr-banks",
"sha256",
"--config", "/dev/null",
+ *(
+ ["--profile-name=custom", "--profile-remove-disabled=check"]
+ if swtpm_setup_version() >= "0.10.0"
+ else []
+ ),
],
sandbox=config.sandbox(options=["--bind", state, workdir(Path(state))]),
stdout=None if ARG_DEBUG.get() else subprocess.DEVNULL,