diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2021-08-25 11:46:34 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-31 17:41:34 +0000 |
commit | 4423276b4607cf1b3975eaff57d17869c0620ecd (patch) | |
tree | a451cd306bd018c1d76ebc35c88f068039570a76 | |
parent | 243b51f740583a1661f2d8209906e87a822cd832 (diff) | |
download | vboot-4423276b4607cf1b3975eaff57d17869c0620ecd.tar.gz |
crossystem: add a hwid override mechanism from chromeos-config
Devices which do not use chromeos firmware (e.g., reven) do not have a
GBB section nor firmware to expose this data via ACPI/device-tree.
However, a hwid is still required for auto-update, UMA, etc.
CL:3118810 adds a new property to the schema for /:hwid-override.
This CL makes it so when that property is set, ACPI/device-tree is not
probed for the HWID, and it is instead set via cros_config.
BUG=b:195007267
BRANCH=none
TEST=build image for reven with a hwid override
# crossystem hwid
REVEN-ANAE A6A-A7I
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: I3c1255b257f914b02dfb8ba53dd275892df1a526
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3119046
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Yong Hong <yhong@chromium.org>
-rw-r--r-- | host/lib/crossystem.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c index a2c2104a..02443b15 100644 --- a/host/lib/crossystem.c +++ b/host/lib/crossystem.c @@ -13,6 +13,7 @@ #include "2common.h" #include "2nvstorage.h" #include "2sysincludes.h" +#include "chromeos_config.h" #include "crossystem_arch.h" #include "crossystem.h" #include "crossystem_vbnv.h" @@ -490,7 +491,19 @@ int VbGetSystemPropertyInt(const char *name) const char *VbGetSystemPropertyString(const char *name, char *dest, size_t size) { - /* Check architecture-dependent properties first */ + /* Check for HWID override via cros_config */ + if (!strcasecmp(name, "hwid")) { + char *hwid_override; + + if (chromeos_config_get_string("/", "hwid-override", + &hwid_override) == VB2_SUCCESS) { + StrCopy(dest, hwid_override, size); + free(hwid_override); + return dest; + } + } + + /* Check architecture-dependent properties */ if (VbGetArchPropertyString(name, dest, size)) return dest; |