summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2018-05-22 17:17:21 +0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2018-05-24 01:47:01 +0000
commitb87660be9fed088e9f25b41d505844027bc3b049 (patch)
tree3fd395ac2a44840acbf5528ba4adb763a52fa38d
parent24ddf5c291d03faaaa05046dd1ef6cc07b4788e0 (diff)
downloadvboot-b87660be9fed088e9f25b41d505844027bc3b049.tar.gz
crossystem: Add BINF3_LEGACY for systems boot in legacy mode.
The BINF3 (VBT7) reflects the firmware type, and we need that to describe which type of firmware was booted. The 'legacy' did not have its own value definition, but without that we can't make sure if the system is running a non-chrome firmware or simply entered legacy boot path. CL:1054307 introduced a new value (0x4) for legacy type and we should handle it in crossystem mainfw_type command. BUG=b:79130310 TEST=emerge-eve coreboot depthcharge chromeos-bootimage; Boot in legacy mode and see crossystem reporting 'legacy' for mainfw_type. Change-Id: I4a1165e547e70c634d45054f56d1357ae5af2a83 Reviewed-on: https://chromium-review.googlesource.com/1068559 Tested-by: Hung-Te Lin <hungte@chromium.org> Trybot-Ready: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org>
-rw-r--r--host/arch/x86/lib/crossystem_arch.c2
-rw-r--r--host/lib/include/crossystem_arch.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/host/arch/x86/lib/crossystem_arch.c b/host/arch/x86/lib/crossystem_arch.c
index 72263dce..befa46d3 100644
--- a/host/arch/x86/lib/crossystem_arch.c
+++ b/host/arch/x86/lib/crossystem_arch.c
@@ -398,6 +398,8 @@ static const char* VbReadMainFwType(char* dest, int size)
/* Try reading type from BINF.3 */
if (ReadFileInt(ACPI_BINF_PATH ".3", &value) == 0) {
switch(value) {
+ case BINF3_LEGACY:
+ return StrCopy(dest, "legacy", size);
case BINF3_NETBOOT:
return StrCopy(dest, "netboot", size);
case BINF3_RECOVERY:
diff --git a/host/lib/include/crossystem_arch.h b/host/lib/include/crossystem_arch.h
index 50198b07..8bd49e5b 100644
--- a/host/lib/include/crossystem_arch.h
+++ b/host/lib/include/crossystem_arch.h
@@ -21,6 +21,7 @@
#define BINF3_NORMAL 1
#define BINF3_DEVELOPER 2
#define BINF3_NETBOOT 3
+#define BINF3_LEGACY 4
/* INTERNAL APIS FOR CROSSYSTEM AVAILABLE TO ARCH-SPECIFIC FUNCTIONS */