update_engine: Place enterprise rollback save marker file
- There are now two types of rollback. One that does a full powerwash
and one that save some system state.
- When an enterprise rollback powerwash is scheduled, place a marker
file to tell the shutdown process to save data before rebooting.
- This lets rollback preserve additional data over a powerwash that
can be restored later.
- Change a few places that were using is_rollback to save_rollback_data
to be explicit.
BUG=chromium:955463
TEST=unittests
Change-Id: I9f18319e711e425a6e712dd319e03bcc6ddd0a1b
Reviewed-on: https://chromium-review.googlesource.com/1414030
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Zentaro Kavanagh <zentaro@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/update_attempter.cc b/update_attempter.cc
index 31a6ce4..44eea77 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -239,6 +239,7 @@
const string& target_channel,
const string& target_version_prefix,
bool rollback_allowed,
+ bool rollback_data_save_requested,
int rollback_allowed_milestones,
bool obey_proxies,
bool interactive) {
@@ -275,6 +276,7 @@
target_channel,
target_version_prefix,
rollback_allowed,
+ rollback_data_save_requested,
rollback_allowed_milestones,
obey_proxies,
interactive)) {
@@ -349,6 +351,7 @@
const string& target_channel,
const string& target_version_prefix,
bool rollback_allowed,
+ bool rollback_data_save_requested,
int rollback_allowed_milestones,
bool obey_proxies,
bool interactive) {
@@ -368,6 +371,10 @@
// Set whether rollback is allowed.
omaha_request_params_->set_rollback_allowed(rollback_allowed);
+ // Set whether saving data over rollback is requested.
+ omaha_request_params_->set_rollback_data_save_requested(
+ rollback_data_save_requested);
+
CalculateStagingParams(interactive);
// If staging_wait_time_ wasn't set, staging is off, use scattering instead.
if (staging_wait_time_.InSeconds() == 0) {
@@ -953,6 +960,7 @@
params.target_channel,
params.target_version_prefix,
params.rollback_allowed,
+ params.rollback_data_save_requested,
params.rollback_allowed_milestones,
/*obey_proxies=*/false,
params.interactive);