secure-boot: Log an error if TPM measurement fails
Log an error if the TPM measurement fails due to the absence or
invalid value of the file '/sys/class/tpm/tpm0/pcr-sha256/0'.
Tested:
Verified that an error is logged when '/sys/class/tpm/tpm0/pcr-sha256/0'
is absent, empty, or has a value of 0, indicating that the TPM
measurement has failed.
```
"Severity" : {
"type" : "s",
"data" : "xyz.openbmc_project.Logging.Entry.Level.Error"
},
"Message" : {
"type" : "s",
"data" : "xyz.openbmc_project.State.Error.TpmMeasurementFail"
},
"AdditionalData" : {
"type" : "as",
"data" : [
"ERROR=TPM measurement value is empty: /sys/class/tpm/tpm0/pcr-sha256/0",
"_PID=501"
]
},
```
Change-Id: I9be610a9b473a529b09feec6643ec65b58a62907
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
diff --git a/meson_options.txt b/meson_options.txt
index bdf0bbc..9c978a0 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -130,3 +130,9 @@
value : 'false',
description : 'Only run automatic restore policy due to loss of AC power.'
)
+
+option('sysfs-tpm-measurement-path', type : 'string',
+ value : '/sys/class/tpm/tpm0/pcr-sha256/0',
+ description : 'The sysfs path to the tpm measurement value.',
+)
+