Check the enrollment in /home/chronos/Local State in addition to the VPD.
This will allow us to migrate the remaining CfMs to the -cfm flavors of
their board images.
BUG=b:157901191
TEST=unit tests, compared behavior with fizz on a Teemo with and without
requisition in VPD, with and without enrollment in Local State JSON.
Cq-Depend: chromium:2239007
Change-Id: I99b05b8530265d4ef4c81472d0be6ba251f7049c
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2242361
Tested-by: Matthew Ziegelbaum <ziegs@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
Commit-Queue: Matthew Ziegelbaum <ziegs@chromium.org>
diff --git a/common/utils.h b/common/utils.h
index ee2dce0..b6880ed 100644
--- a/common/utils.h
+++ b/common/utils.h
@@ -291,6 +291,10 @@
// reboot. Returns whether it succeeded getting the boot_id.
bool GetBootId(std::string* boot_id);
+// Gets a string value from the vpd for a given key using the `vpd_get_value`
+// shell command. Returns true on success.
+bool GetVpdValue(std::string key, std::string* result);
+
// Divide |x| by |y| and round up to the nearest integer.
constexpr uint64_t DivRoundUp(uint64_t x, uint64_t y) {
return (x + y - 1) / y;