summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Anderson <dianders@chromium.org>2022-12-13 16:02:15 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-12-15 03:53:19 +0000
commit167d3873450dcd5d735a07d647462829f16b2061 (patch)
tree5cd2fc8d43707954e8565151606c14959189b842
parent690bdd66ec89ba74bba4c369b6f1700a1c180b74 (diff)
downloadvboot-167d3873450dcd5d735a07d647462829f16b2061.tar.gz
crossystem: Print an error log if we fall back to WPSW_BOOT
On new systems, WPSW_BOOT is potentially bogus. The BIOS doesn't set it so it always reports that the device is _not_ write protected. Let's print an error log so we have an idea if we ever fall back. BRANCH=None BUG=b:249498455, b:254337014 TEST=Force a failure and see the log Change-Id: Ie741ca9f9f938382ea7e56cfd81bd273dd9bb548 Signed-off-by: Douglas Anderson <dianders@chromium.org> Disallow-Recycled-Builds: test-failures Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4104708 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Brian Norris <briannorris@chromium.org>
-rw-r--r--host/lib/crossystem.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c
index 8ac5e537..a7b04b99 100644
--- a/host/lib/crossystem.c
+++ b/host/lib/crossystem.c
@@ -473,6 +473,9 @@ int VbGetSystemPropertyInt(const char *name)
} else if (!strcasecmp(name, "wpsw_cur")) {
/* Use "write-protect at boot" as a fallback value. */
value = GetVdatInt(VDAT_INT_HW_WPSW_BOOT);
+ fprintf(stderr,
+ "Fallback to WPSW_BOOT (%d), which may be invalid\n",
+ value);
} else if (!strcasecmp(name,"vdat_flags")) {
value = GetVdatInt(VDAT_INT_FLAGS);
} else if (!strcasecmp(name,"tpm_fwver")) {