tpm2-clear: make it clear that we default to true for systemd.tpm2_allow_clear

This commit is contained in:
Mike Yuan
2025-03-05 16:13:55 +01:00
parent 5c7b3335db
commit f1d790a18b

View File

@@ -94,14 +94,15 @@ static int request_tpm2_clear(void) {
if (clear < 0) {
bool b;
r = proc_cmdline_get_bool("systemd.tpm2_allow_clear", /* flags= */ 0, &b);
r = proc_cmdline_get_bool("systemd.tpm2_allow_clear", PROC_CMDLINE_TRUE_WHEN_MISSING, &b);
if (r < 0)
return log_error_errno(r, "Failed to parse systemd.tpm2_allow_clear kernel command line argument: %m");
if (r > 0)
clear = b;
clear = b;
}
if (clear == 0) {
assert(clear >= 0);
if (!clear) {
log_info("Clearing TPM2 disabled, exiting early.");
return 0;
}