]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pcrlock: don't fail if firmware measurements aren't available
authorLennart Poettering <lennart@amutable.com>
Tue, 10 Mar 2026 07:04:52 +0000 (08:04 +0100)
committerLennart Poettering <lennart@amutable.com>
Thu, 26 Mar 2026 15:11:34 +0000 (16:11 +0100)
With swtpm in place we now commonly have systems where TPM is available
during runtime, but not in the firmware. Handle that nicely.

src/pcrlock/pcrlock.c

index ddae43dc54895c414de1d3a93cfbab10aef0bd41..c940ab01e8d9be7d8c715f181f3b34ae23029d46 100644 (file)
@@ -899,6 +899,10 @@ static int event_log_load_firmware(EventLog *el) {
         path = tpm2_firmware_log_path();
 
         r = read_full_file(path, (char**) &buf, &bufsize);
+        if (r == -ENOENT) {
+                log_notice("No '%s' file, assuming TPM without firmware support.", path);
+                return 0;
+        }
         if (r < 0)
                 return log_error_errno(r, "Failed to open TPM2 event log '%s': %m", path);