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 // 16 17 #include "update_engine/common/constants.h" 18 19 namespace chromeos_update_engine { 20 21 const char kExclusionPrefsSubDir[] = "exclusion"; 22 23 const char kDlcPrefsSubDir[] = "dlc"; 24 25 const char kPowerwashSafePrefsSubDirectory[] = "update_engine/prefs"; 26 27 const char kPrefsSubDirectory[] = "prefs"; 28 29 const char kStatefulPartition[] = "/mnt/stateful_partition"; 30 31 const char kPostinstallDefaultScript[] = "postinst"; 32 33 // Constants defining keys for the persisted state of update engine. 34 const char kPrefsAttemptInProgress[] = "attempt-in-progress"; 35 const char kPrefsBackoffExpiryTime[] = "backoff-expiry-time"; 36 const char kPrefsBootId[] = "boot-id"; 37 const char kPrefsCurrentBytesDownloaded[] = "current-bytes-downloaded"; 38 const char kPrefsCurrentResponseSignature[] = "current-response-signature"; 39 const char kPrefsCurrentUrlFailureCount[] = "current-url-failure-count"; 40 const char kPrefsCurrentUrlIndex[] = "current-url-index"; 41 const char kPrefsDailyMetricsLastReportedAt[] = 42 "daily-metrics-last-reported-at"; 43 const char kPrefsDeltaUpdateFailures[] = "delta-update-failures"; 44 const char kPrefsDynamicPartitionMetadataUpdated[] = 45 "dynamic-partition-metadata-updated"; 46 const char kPrefsFullPayloadAttemptNumber[] = "full-payload-attempt-number"; 47 const char kPrefsInstallDateDays[] = "install-date-days"; 48 const char kPrefsLastActivePingDay[] = "last-active-ping-day"; 49 const char kPrefsLastRollCallPingDay[] = "last-roll-call-ping-day"; 50 const char kPrefsManifestMetadataSize[] = "manifest-metadata-size"; 51 const char kPrefsManifestSignatureSize[] = "manifest-signature-size"; 52 const char kPrefsMetricsAttemptLastReportingTime[] = 53 "metrics-attempt-last-reporting-time"; 54 const char kPrefsMetricsCheckLastReportingTime[] = 55 "metrics-check-last-reporting-time"; 56 const char kPrefsNoIgnoreBackoff[] = "no-ignore-backoff"; 57 const char kPrefsNumReboots[] = "num-reboots"; 58 const char kPrefsNumResponsesSeen[] = "num-responses-seen"; 59 const char kPrefsOmahaCohort[] = "omaha-cohort"; 60 const char kPrefsOmahaCohortHint[] = "omaha-cohort-hint"; 61 const char kPrefsOmahaCohortName[] = "omaha-cohort-name"; 62 const char kPrefsOmahaEolDate[] = "omaha-eol-date"; 63 const char kPrefsP2PEnabled[] = "p2p-enabled"; 64 const char kPrefsP2PFirstAttemptTimestamp[] = "p2p-first-attempt-timestamp"; 65 const char kPrefsP2PNumAttempts[] = "p2p-num-attempts"; 66 const char kPrefsPayloadAttemptNumber[] = "payload-attempt-number"; 67 const char kPrefsTestUpdateCheckIntervalTimeout[] = 68 "test-update-check-interval-timeout"; 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"; 74 const char kPrefsLastFp[] = "last-fp"; 75 const char kPrefsPostInstallSucceeded[] = "post-install-succeeded"; 76 const char kPrefsPreviousVersion[] = "previous-version"; 77 const char kPrefsResumedUpdateFailures[] = "resumed-update-failures"; 78 const char kPrefsRollbackHappened[] = "rollback-happened"; 79 const char kPrefsRollbackVersion[] = "rollback-version"; 80 const char kPrefsChannelOnSlotPrefix[] = "channel-on-slot-"; 81 const char kPrefsSystemUpdatedMarker[] = "system-updated-marker"; 82 const char kPrefsTargetVersionAttempt[] = "target-version-attempt"; 83 const char kPrefsTargetVersionInstalledFrom[] = "target-version-installed-from"; 84 const char kPrefsTargetVersionUniqueId[] = "target-version-unique-id"; 85 const char kPrefsTotalBytesDownloaded[] = "total-bytes-downloaded"; 86 const char kPrefsUpdateCheckCount[] = "update-check-count"; 87 const char kPrefsUpdateCheckResponseHash[] = "update-check-response-hash"; 88 const char kPrefsUpdateCompletedBootTime[] = "update-completed-boot-time"; 89 const char kPrefsUpdateCompletedOnBootId[] = "update-completed-on-boot-id"; 90 const char kPrefsUpdateDurationUptime[] = "update-duration-uptime"; 91 const char kPrefsUpdateFirstSeenAt[] = "update-first-seen-at"; 92 const char kPrefsUpdateOverCellularPermission[] = 93 "update-over-cellular-permission"; 94 const char kPrefsUpdateOverCellularTargetVersion[] = 95 "update-over-cellular-target-version"; 96 const char kPrefsUpdateOverCellularTargetSize[] = 97 "update-over-cellular-target-size"; 98 const char kPrefsUpdateServerCertificate[] = "update-server-cert"; 99 const char kPrefsUpdateStateNextDataLength[] = "update-state-next-data-length"; 100 const char kPrefsUpdateStateNextDataOffset[] = "update-state-next-data-offset"; 101 const char kPrefsUpdateStateNextOperation[] = "update-state-next-operation"; 102 const char kPrefsUpdateStatePayloadIndex[] = "update-state-payload-index"; 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"; 107 const char kPrefsUpdateBootTimestampStart[] = "update-boot-timestamp-start"; 108 const char kPrefsUpdateTimestampStart[] = "update-timestamp-start"; 109 const char kPrefsUrlSwitchCount[] = "url-switch-count"; 110 const char kPrefsVerityWritten[] = "verity-written"; 111 const char kPrefsWallClockScatteringWaitPeriod[] = "wall-clock-wait-period"; 112 const char kPrefsWallClockStagingWaitPeriod[] = 113 "wall-clock-staging-wait-period"; 114 const char kPrefsManifestBytes[] = "manifest-bytes"; 115 const char kPrefsPreviousSlot[] = "previous-slot"; 116 117 // These four fields are generated by scripts/brillo_update_payload. 118 const char kPayloadPropertyFileSize[] = "FILE_SIZE"; 119 const char kPayloadPropertyFileHash[] = "FILE_HASH"; 120 const char kPayloadPropertyMetadataSize[] = "METADATA_SIZE"; 121 const char kPayloadPropertyMetadataHash[] = "METADATA_HASH"; 122 // The Authorization: HTTP header to be sent when downloading the payload. 123 const char kPayloadPropertyAuthorization[] = "AUTHORIZATION"; 124 // The User-Agent HTTP header to be sent when downloading the payload. 125 const char kPayloadPropertyUserAgent[] = "USER_AGENT"; 126 // Set "POWERWASH=1" to powerwash (factory data reset) the device after 127 // applying the update. 128 const char kPayloadPropertyPowerwash[] = "POWERWASH"; 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. 132 const char kPayloadPropertyNetworkId[] = "NETWORK_ID"; 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"; 136 // Set "RUN_POST_INSTALL=0" to skip running optional post install. 137 // The default is 1 (always run post install). 138 const char kPayloadPropertyRunPostInstall[] = "RUN_POST_INSTALL"; 139 140 const char kOmahaUpdaterVersion[] = "0.1.0.0"; 141 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 148 } // namespace chromeos_update_engine 149