update_engine: Update the TPM with max_rollforward on rollback
- Determines the value from max_rollforward_(kernel|firmware)
based on the list of the last N release values from stable.
- Sets the TPM values once it has been determined that the new
image will boot and be installed.
BUG=chromium:840432
TEST=cros_run_unit_tests --board=samus --packages update_engine
Change-Id: I9620fe01cfea49e798e1397dada55ec6bec93047
Reviewed-on: https://chromium-review.googlesource.com/1419006
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Bailey Berro <baileyberro@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/omaha_request_params.h b/omaha_request_params.h
index 18235c0..6691bee 100644
--- a/omaha_request_params.h
+++ b/omaha_request_params.h
@@ -132,6 +132,14 @@
inline bool rollback_allowed() const { return rollback_allowed_; }
+ inline void set_rollback_allowed_milestones(int rollback_allowed_milestones) {
+ rollback_allowed_milestones_ = rollback_allowed_milestones;
+ }
+
+ inline int rollback_allowed_milestones() const {
+ return rollback_allowed_milestones_;
+ }
+
inline void set_wall_clock_based_wait_enabled(bool enabled) {
wall_clock_based_wait_enabled_ = enabled;
}
@@ -322,6 +330,9 @@
// Whether the client is accepting rollback images too.
bool rollback_allowed_;
+ // How many milestones the client can rollback to.
+ int rollback_allowed_milestones_;
+
// True if scattering or staging are enabled, in which case waiting_period_
// specifies the amount of absolute time that we've to wait for before sending
// a request to Omaha.