Alex Deymo | aea4c1c | 2015-08-19 20:24:43 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2013 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 16 | |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 17 | #include "update_engine/common/constants.h" |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 18 | |
| 19 | namespace chromeos_update_engine { |
| 20 | |
Jae Hoon Kim | 38de3b1 | 2020-04-29 19:41:23 -0700 | [diff] [blame] | 21 | const char kExclusionPrefsSubDir[] = "exclusion"; |
| 22 | |
Andrew | 065d78d | 2020-04-07 15:43:07 -0700 | [diff] [blame] | 23 | const char kDlcPrefsSubDir[] = "dlc"; |
Andrew | e045aef | 2020-01-08 16:29:22 -0800 | [diff] [blame] | 24 | |
Alex Deymo | dd132f3 | 2015-09-14 19:12:07 -0700 | [diff] [blame] | 25 | const char kPowerwashSafePrefsSubDirectory[] = "update_engine/prefs"; |
Chris Sosa | aa18e16 | 2013-06-20 13:20:30 -0700 | [diff] [blame] | 26 | |
Alex Deymo | dd132f3 | 2015-09-14 19:12:07 -0700 | [diff] [blame] | 27 | const char kPrefsSubDirectory[] = "prefs"; |
Chris Sosa | aa18e16 | 2013-06-20 13:20:30 -0700 | [diff] [blame] | 28 | |
| 29 | const char kStatefulPartition[] = "/mnt/stateful_partition"; |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 30 | |
Alex Deymo | 390efed | 2016-02-18 11:00:40 -0800 | [diff] [blame] | 31 | const char kPostinstallDefaultScript[] = "postinst"; |
| 32 | |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 33 | // Constants defining keys for the persisted state of update engine. |
David Zeuthen | 4e1d149 | 2014-04-25 13:12:27 -0700 | [diff] [blame] | 34 | const char kPrefsAttemptInProgress[] = "attempt-in-progress"; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 35 | const char kPrefsBackoffExpiryTime[] = "backoff-expiry-time"; |
Alex Deymo | dd132f3 | 2015-09-14 19:12:07 -0700 | [diff] [blame] | 36 | const char kPrefsBootId[] = "boot-id"; |
Jay Srinivasan | 19409b7 | 2013-04-12 19:23:36 -0700 | [diff] [blame] | 37 | const char kPrefsCurrentBytesDownloaded[] = "current-bytes-downloaded"; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 38 | const char kPrefsCurrentResponseSignature[] = "current-response-signature"; |
| 39 | const char kPrefsCurrentUrlFailureCount[] = "current-url-failure-count"; |
| 40 | const char kPrefsCurrentUrlIndex[] = "current-url-index"; |
David Zeuthen | 985b112 | 2013-10-09 12:13:15 -0700 | [diff] [blame] | 41 | const char kPrefsDailyMetricsLastReportedAt[] = |
| 42 | "daily-metrics-last-reported-at"; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 43 | const char kPrefsDeltaUpdateFailures[] = "delta-update-failures"; |
Tao Bao | 3406c77 | 2019-01-02 15:34:35 -0800 | [diff] [blame] | 44 | const char kPrefsDynamicPartitionMetadataUpdated[] = |
| 45 | "dynamic-partition-metadata-updated"; |
Alex Deymo | 820cc70 | 2013-06-28 15:43:46 -0700 | [diff] [blame] | 46 | const char kPrefsFullPayloadAttemptNumber[] = "full-payload-attempt-number"; |
David Zeuthen | 639aa36 | 2014-02-03 16:23:44 -0800 | [diff] [blame] | 47 | const char kPrefsInstallDateDays[] = "install-date-days"; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 48 | const char kPrefsLastActivePingDay[] = "last-active-ping-day"; |
| 49 | const char kPrefsLastRollCallPingDay[] = "last-roll-call-ping-day"; |
| 50 | const char kPrefsManifestMetadataSize[] = "manifest-metadata-size"; |
Alex Deymo | f25eb49 | 2016-02-26 00:20:08 -0800 | [diff] [blame] | 51 | const char kPrefsManifestSignatureSize[] = "manifest-signature-size"; |
David Zeuthen | 33bae49 | 2014-02-25 16:16:18 -0800 | [diff] [blame] | 52 | const char kPrefsMetricsAttemptLastReportingTime[] = |
| 53 | "metrics-attempt-last-reporting-time"; |
| 54 | const char kPrefsMetricsCheckLastReportingTime[] = |
| 55 | "metrics-check-last-reporting-time"; |
Amin Hassani | ffb6d80 | 2018-03-30 11:43:57 -0700 | [diff] [blame] | 56 | const char kPrefsNoIgnoreBackoff[] = "no-ignore-backoff"; |
Chris Sosa | be45bef | 2013-04-09 18:25:12 -0700 | [diff] [blame] | 57 | const char kPrefsNumReboots[] = "num-reboots"; |
David Zeuthen | a573d6f | 2013-06-14 16:13:36 -0700 | [diff] [blame] | 58 | const char kPrefsNumResponsesSeen[] = "num-responses-seen"; |
Alex Deymo | 8e18f93 | 2015-03-27 16:16:59 -0700 | [diff] [blame] | 59 | const char kPrefsOmahaCohort[] = "omaha-cohort"; |
| 60 | const char kPrefsOmahaCohortHint[] = "omaha-cohort-hint"; |
| 61 | const char kPrefsOmahaCohortName[] = "omaha-cohort-name"; |
Jae Hoon Kim | 051627a | 2019-09-03 12:56:32 -0700 | [diff] [blame] | 62 | const char kPrefsOmahaEolDate[] = "omaha-eol-date"; |
David Zeuthen | 27a48bc | 2013-08-06 12:06:29 -0700 | [diff] [blame] | 63 | const char kPrefsP2PEnabled[] = "p2p-enabled"; |
David Zeuthen | 639aa36 | 2014-02-03 16:23:44 -0800 | [diff] [blame] | 64 | const char kPrefsP2PFirstAttemptTimestamp[] = "p2p-first-attempt-timestamp"; |
| 65 | const char kPrefsP2PNumAttempts[] = "p2p-num-attempts"; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 66 | const char kPrefsPayloadAttemptNumber[] = "payload-attempt-number"; |
Amin Hassani | 03277de | 2020-07-28 12:32:49 -0700 | [diff] [blame] | 67 | const char kPrefsTestUpdateCheckIntervalTimeout[] = |
| 68 | "test-update-check-interval-timeout"; |
Andrew | e045aef | 2020-01-08 16:29:22 -0800 | [diff] [blame] | 69 | // Keep |kPrefsPingActive| in sync with |kDlcMetadataFilePingActive| in |
| 70 | // dlcservice. |
| 71 | const char kPrefsPingActive[] = "active"; |
| 72 | const char kPrefsPingLastActive[] = "date_last_active"; |
| 73 | const char kPrefsPingLastRollcall[] = "date_last_rollcall"; |
Vyshu Khota | 4c5413d | 2020-11-04 16:17:25 -0800 | [diff] [blame] | 74 | const char kPrefsLastFp[] = "last-fp"; |
Sen Jiang | 02c4942 | 2017-10-31 15:14:11 -0700 | [diff] [blame] | 75 | const char kPrefsPostInstallSucceeded[] = "post-install-succeeded"; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 76 | const char kPrefsPreviousVersion[] = "previous-version"; |
| 77 | const char kPrefsResumedUpdateFailures[] = "resumed-update-failures"; |
Marton Hunyady | e58bddb | 2018-04-10 20:27:26 +0200 | [diff] [blame] | 78 | const char kPrefsRollbackHappened[] = "rollback-happened"; |
Chris Sosa | aa18e16 | 2013-06-20 13:20:30 -0700 | [diff] [blame] | 79 | const char kPrefsRollbackVersion[] = "rollback-version"; |
Alex Deymo | 8561665 | 2015-10-15 18:48:31 -0700 | [diff] [blame] | 80 | const char kPrefsChannelOnSlotPrefix[] = "channel-on-slot-"; |
David Zeuthen | e4c58bf | 2013-06-18 17:26:50 -0700 | [diff] [blame] | 81 | const char kPrefsSystemUpdatedMarker[] = "system-updated-marker"; |
Alex Deymo | 4243291 | 2013-07-12 20:21:15 -0700 | [diff] [blame] | 82 | const char kPrefsTargetVersionAttempt[] = "target-version-attempt"; |
| 83 | const char kPrefsTargetVersionInstalledFrom[] = "target-version-installed-from"; |
| 84 | const char kPrefsTargetVersionUniqueId[] = "target-version-unique-id"; |
Jay Srinivasan | 19409b7 | 2013-04-12 19:23:36 -0700 | [diff] [blame] | 85 | const char kPrefsTotalBytesDownloaded[] = "total-bytes-downloaded"; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 86 | const char kPrefsUpdateCheckCount[] = "update-check-count"; |
| 87 | const char kPrefsUpdateCheckResponseHash[] = "update-check-response-hash"; |
Alex Deymo | 906191f | 2015-10-12 12:22:44 -0700 | [diff] [blame] | 88 | const char kPrefsUpdateCompletedBootTime[] = "update-completed-boot-time"; |
| 89 | const char kPrefsUpdateCompletedOnBootId[] = "update-completed-on-boot-id"; |
David Zeuthen | cc6f996 | 2013-04-18 11:57:24 -0700 | [diff] [blame] | 90 | const char kPrefsUpdateDurationUptime[] = "update-duration-uptime"; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 91 | const char kPrefsUpdateFirstSeenAt[] = "update-first-seen-at"; |
Alex Deymo | f4867c4 | 2013-06-28 14:41:39 -0700 | [diff] [blame] | 92 | const char kPrefsUpdateOverCellularPermission[] = |
| 93 | "update-over-cellular-permission"; |
Weidong Guo | 421ff33 | 2017-04-17 10:08:38 -0700 | [diff] [blame] | 94 | const char kPrefsUpdateOverCellularTargetVersion[] = |
| 95 | "update-over-cellular-target-version"; |
| 96 | const char kPrefsUpdateOverCellularTargetSize[] = |
| 97 | "update-over-cellular-target-size"; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 98 | const char kPrefsUpdateServerCertificate[] = "update-server-cert"; |
David Zeuthen | 41996ad | 2013-09-24 15:43:24 -0700 | [diff] [blame] | 99 | const char kPrefsUpdateStateNextDataLength[] = "update-state-next-data-length"; |
David Zeuthen | 639aa36 | 2014-02-03 16:23:44 -0800 | [diff] [blame] | 100 | const char kPrefsUpdateStateNextDataOffset[] = "update-state-next-data-offset"; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 101 | const char kPrefsUpdateStateNextOperation[] = "update-state-next-operation"; |
Sen Jiang | 0affc2c | 2017-02-10 15:55:05 -0800 | [diff] [blame] | 102 | const char kPrefsUpdateStatePayloadIndex[] = "update-state-payload-index"; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 103 | const char kPrefsUpdateStateSHA256Context[] = "update-state-sha-256-context"; |
| 104 | const char kPrefsUpdateStateSignatureBlob[] = "update-state-signature-blob"; |
| 105 | const char kPrefsUpdateStateSignedSHA256Context[] = |
| 106 | "update-state-signed-sha-256-context"; |
Tianjie Xu | 2a0ea63 | 2018-08-06 12:59:23 -0700 | [diff] [blame] | 107 | const char kPrefsUpdateBootTimestampStart[] = "update-boot-timestamp-start"; |
David Zeuthen | 9a017f2 | 2013-04-11 16:10:26 -0700 | [diff] [blame] | 108 | const char kPrefsUpdateTimestampStart[] = "update-timestamp-start"; |
David Zeuthen | cc6f996 | 2013-04-18 11:57:24 -0700 | [diff] [blame] | 109 | const char kPrefsUrlSwitchCount[] = "url-switch-count"; |
Sen Jiang | 3eeaf7d | 2018-10-11 13:55:32 -0700 | [diff] [blame] | 110 | const char kPrefsVerityWritten[] = "verity-written"; |
Adolfo Victoria | d3a1e35 | 2018-07-16 11:40:47 -0700 | [diff] [blame] | 111 | const char kPrefsWallClockScatteringWaitPeriod[] = "wall-clock-wait-period"; |
| 112 | const char kPrefsWallClockStagingWaitPeriod[] = |
| 113 | "wall-clock-staging-wait-period"; |
Kelvin Zhang | cc011d3 | 2020-07-10 18:20:08 -0400 | [diff] [blame] | 114 | const char kPrefsManifestBytes[] = "manifest-bytes"; |
Kelvin Zhang | 8660347 | 2021-05-11 12:16:27 -0400 | [diff] [blame^] | 115 | const char kPrefsPreviousSlot[] = "previous-slot"; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 116 | |
Elliott Hughes | b1e3e3c | 2017-02-28 15:15:38 -0800 | [diff] [blame] | 117 | // These four fields are generated by scripts/brillo_update_payload. |
Alex Deymo | 98e691c | 2016-02-04 21:05:45 -0800 | [diff] [blame] | 118 | const char kPayloadPropertyFileSize[] = "FILE_SIZE"; |
| 119 | const char kPayloadPropertyFileHash[] = "FILE_HASH"; |
| 120 | const char kPayloadPropertyMetadataSize[] = "METADATA_SIZE"; |
| 121 | const char kPayloadPropertyMetadataHash[] = "METADATA_HASH"; |
Elliott Hughes | b1e3e3c | 2017-02-28 15:15:38 -0800 | [diff] [blame] | 122 | // The Authorization: HTTP header to be sent when downloading the payload. |
Alex Deymo | fdd6dec | 2016-03-03 22:35:43 -0800 | [diff] [blame] | 123 | const char kPayloadPropertyAuthorization[] = "AUTHORIZATION"; |
Elliott Hughes | b1e3e3c | 2017-02-28 15:15:38 -0800 | [diff] [blame] | 124 | // The User-Agent HTTP header to be sent when downloading the payload. |
Alex Deymo | fdd6dec | 2016-03-03 22:35:43 -0800 | [diff] [blame] | 125 | const char kPayloadPropertyUserAgent[] = "USER_AGENT"; |
Elliott Hughes | b1e3e3c | 2017-02-28 15:15:38 -0800 | [diff] [blame] | 126 | // Set "POWERWASH=1" to powerwash (factory data reset) the device after |
| 127 | // applying the update. |
Alex Deymo | fb905d9 | 2016-06-03 19:26:58 -0700 | [diff] [blame] | 128 | const char kPayloadPropertyPowerwash[] = "POWERWASH"; |
Elliott Hughes | b1e3e3c | 2017-02-28 15:15:38 -0800 | [diff] [blame] | 129 | // The network id to pass to android_setprocnetwork before downloading. |
| 130 | // This can be used to zero-rate OTA traffic by sending it over the correct |
| 131 | // network. |
Alex Deymo | 87792ea | 2016-07-25 15:40:36 -0700 | [diff] [blame] | 132 | const char kPayloadPropertyNetworkId[] = "NETWORK_ID"; |
Sen Jiang | 02c4942 | 2017-10-31 15:14:11 -0700 | [diff] [blame] | 133 | // Set "SWITCH_SLOT_ON_REBOOT=0" to skip marking the updated partitions active. |
| 134 | // The default is 1 (always switch slot if update succeeded). |
| 135 | const char kPayloadPropertySwitchSlotOnReboot[] = "SWITCH_SLOT_ON_REBOOT"; |
Tianjie Xu | 087de9d | 2019-11-01 17:11:22 -0700 | [diff] [blame] | 136 | // Set "RUN_POST_INSTALL=0" to skip running optional post install. |
Sen Jiang | 02c4942 | 2017-10-31 15:14:11 -0700 | [diff] [blame] | 137 | // The default is 1 (always run post install). |
| 138 | const char kPayloadPropertyRunPostInstall[] = "RUN_POST_INSTALL"; |
Alex Deymo | 98e691c | 2016-02-04 21:05:45 -0800 | [diff] [blame] | 139 | |
Amin Hassani | 7fca286 | 2019-03-28 16:09:22 -0700 | [diff] [blame] | 140 | const char kOmahaUpdaterVersion[] = "0.1.0.0"; |
| 141 | |
Jae Hoon Kim | 0ae8fe1 | 2019-06-26 14:32:50 -0700 | [diff] [blame] | 142 | // X-Goog-Update headers. |
| 143 | const char kXGoogleUpdateInteractivity[] = "X-Goog-Update-Interactivity"; |
| 144 | const char kXGoogleUpdateAppId[] = "X-Goog-Update-AppId"; |
| 145 | const char kXGoogleUpdateUpdater[] = "X-Goog-Update-Updater"; |
| 146 | const char kXGoogleUpdateSessionId[] = "X-Goog-SessionId"; |
| 147 | |
Alex Vakulenko | d2779df | 2014-06-16 13:19:00 -0700 | [diff] [blame] | 148 | } // namespace chromeos_update_engine |