update_engine: Process Omaha response for rollback images
Omaha returns whether the image returned is a rollback in the
_rollback="true" argument. If this is set, the client has to check
whether it's OK to apply the rollback image (policy is specifically
requesting a rollback and verified boot will accept the image based
on its kernel and firmware key versions).
In addition to this, the device has to do a safe powerwash if the
image is a rollback. (We're not supporting rollbacks with partial
or no powerwash yet.)
We're also setting the rollback_happened preference to avoid force
updates happening before the policy is available again.
Chromium CL adding the error code: http://crrev.com/c/1047866
BUG=chromium:840432
TEST='cros_run_unit_tests --board=caroline --packages update_engine'
Change-Id: I1436ca96211b2a8523e78bf83602ef8b6b525570
Reviewed-on: https://chromium-review.googlesource.com/1047610
Commit-Ready: Marton Hunyady <hunyadym@chromium.org>
Tested-by: Marton Hunyady <hunyadym@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/omaha_response.h b/omaha_response.h
index b973eb5..e57f291 100644
--- a/omaha_response.h
+++ b/omaha_response.h
@@ -80,6 +80,15 @@
// PST, according to the Omaha Server's clock and timezone (PST8PDT,
// aka "Pacific Time".)
int install_date_days = -1;
+
+ // True if the returned image is a rollback for the device.
+ bool is_rollback = false;
+ // Kernel version of the returned rollback image. 0 if the image is not a
+ // rollback.
+ uint32_t kernel_version = 0;
+ // Firmware version of the returned rollback image. 0 if the image is not a
+ // rollback.
+ uint32_t firmware_version = 0;
};
static_assert(sizeof(off_t) == 8, "off_t not 64 bit");