summaryrefslogtreecommitdiff
path: root/common/constants.cc
diff options
context:
space:
mode:
authorSen Jiang <senj@google.com>2017-10-31 15:14:11 -0700
committerSen Jiang <senj@google.com>2017-11-01 16:50:30 -0700
commitfe5228282571154b51d3907cad4744e228e66a22 (patch)
tree0ba712bc0a948783ede564bd73d3f6268af3251e /common/constants.cc
parent54e6868331ac10558f8bcb25c5448097a548b268 (diff)
Add support for new payload property headers to delay switching slots.
Set SWITCH_SLOT_ON_REBOOT=0 to skip marking new slot as active. When ready to reboot to the new update, call applyPayload() again to switch the slots, download will be skipped because it has already finished, filesystem verification will always happen, and postinstall can be skipped if it succeeded before for this update and RUN_POST_INSTALL is set to 0. Also removed reset update progress when update succeeded to support reverting to current slot with resetStatus() without clearing download progress. If the next update is a different payload then we will still reset the progress on next update. Bug: 35212183 Test: update_device.py --extra-headers 'SWITCH_SLOT_ON_REBOOT=0' ... Merged-In: I52e2371ea4a9e6a6d026b4dd04bb1a60d95c9d5c Change-Id: I52e2371ea4a9e6a6d026b4dd04bb1a60d95c9d5c (cherry picked from commit e9685de187317c3bc92a2d63d3f4a40b9831f448)
Diffstat (limited to 'common/constants.cc')
-rw-r--r--common/constants.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/constants.cc b/common/constants.cc
index c0a6e279..5941c93b 100644
--- a/common/constants.cc
+++ b/common/constants.cc
@@ -57,6 +57,7 @@ const char kPrefsP2PEnabled[] = "p2p-enabled";
const char kPrefsP2PFirstAttemptTimestamp[] = "p2p-first-attempt-timestamp";
const char kPrefsP2PNumAttempts[] = "p2p-num-attempts";
const char kPrefsPayloadAttemptNumber[] = "payload-attempt-number";
+const char kPrefsPostInstallSucceeded[] = "post-install-succeeded";
const char kPrefsPreviousVersion[] = "previous-version";
const char kPrefsResumedUpdateFailures[] = "resumed-update-failures";
const char kPrefsRollbackVersion[] = "rollback-version";
@@ -103,5 +104,12 @@ const char kPayloadPropertyPowerwash[] = "POWERWASH";
// This can be used to zero-rate OTA traffic by sending it over the correct
// network.
const char kPayloadPropertyNetworkId[] = "NETWORK_ID";
+// Set "SWITCH_SLOT_ON_REBOOT=0" to skip marking the updated partitions active.
+// The default is 1 (always switch slot if update succeeded).
+const char kPayloadPropertySwitchSlotOnReboot[] = "SWITCH_SLOT_ON_REBOOT";
+// Set "RUN_POST_INSTALL=0" to skip running post install, this will only be
+// honored if we're resuming an update and post install has already succeeded.
+// The default is 1 (always run post install).
+const char kPayloadPropertyRunPostInstall[] = "RUN_POST_INSTALL";
} // namespace chromeos_update_engine