cros_flash: Handle App ID mismatch between device and payload
Nebraska (used in DUT by cros flash) requires exact matching of App ID
that comes from update_engine and the one generated during
paygen. However, sometimes we do want to cros flash a device that has
board X installed, with a different an image for board Y. In this case,
Nebraska fails to match the requests based on different App IDs by
design. However, in the past we have implemented an escape valve where
setting the App ID of the payload's properties file to a sub-string of
the App ID of the device, will allow a partial matching of the App
IDs. So now in order to let this go through in cros flash, whenever we
detect a mismatch of the App ID, we empty the 'appid' field of the
payload properties file before AUing the device. This allows Nebraska to
do partial matching.
BUG=chromium:1005886
TEST=changed the /etc/lsb-release file on the DUT to something else and
then cros flashed. cros flash was successful and it showed a warning
about the App ID mismatch.
Change-Id: I433fbbd45b795c1347aab9d6011dbef9bba404b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1815572
Commit-Queue: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Ross Zwisler <zwisler@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/cli/flash.py b/cli/flash.py
index 3628c74..c892521 100644
--- a/cli/flash.py
+++ b/cli/flash.py
@@ -487,6 +487,7 @@
send_payload_in_parallel=self.send_payload_in_parallel,
experimental_au=self.experimental_au)
chromeos_AU.CheckPayloads()
+ chromeos_AU.ResolveAPPIDMismatchIfAny()
chromeos_AU.RunUpdate()
except Exception: