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 kPowerwashSafePrefsSubDirectory[] = "update_engine/prefs"; 22 23 const char kPrefsSubDirectory[] = "prefs"; 24 25 const char kStatefulPartition[] = "/mnt/stateful_partition"; 26 27 const char kPostinstallDefaultScript[] = "postinst"; 28 29 // Constants defining keys for the persisted state of update engine. 30 const char kPrefsAttemptInProgress[] = "attempt-in-progress"; 31 const char kPrefsBackoffExpiryTime[] = "backoff-expiry-time"; 32 const char kPrefsBootId[] = "boot-id"; 33 const char kPrefsCurrentBytesDownloaded[] = "current-bytes-downloaded"; 34 const char kPrefsCurrentResponseSignature[] = "current-response-signature"; 35 const char kPrefsCurrentUrlFailureCount[] = "current-url-failure-count"; 36 const char kPrefsCurrentUrlIndex[] = "current-url-index"; 37 const char kPrefsDailyMetricsLastReportedAt[] = 38 "daily-metrics-last-reported-at"; 39 const char kPrefsDeltaUpdateFailures[] = "delta-update-failures"; 40 const char kPrefsFullPayloadAttemptNumber[] = "full-payload-attempt-number"; 41 const char kPrefsInstallDateDays[] = "install-date-days"; 42 const char kPrefsLastActivePingDay[] = "last-active-ping-day"; 43 const char kPrefsLastRollCallPingDay[] = "last-roll-call-ping-day"; 44 const char kPrefsManifestMetadataSize[] = "manifest-metadata-size"; 45 const char kPrefsManifestSignatureSize[] = "manifest-signature-size"; 46 const char kPrefsMetricsAttemptLastReportingTime[] = 47 "metrics-attempt-last-reporting-time"; 48 const char kPrefsMetricsCheckLastReportingTime[] = 49 "metrics-check-last-reporting-time"; 50 const char kPrefsNumReboots[] = "num-reboots"; 51 const char kPrefsNumResponsesSeen[] = "num-responses-seen"; 52 const char kPrefsOmahaCohort[] = "omaha-cohort"; 53 const char kPrefsOmahaCohortHint[] = "omaha-cohort-hint"; 54 const char kPrefsOmahaCohortName[] = "omaha-cohort-name"; 55 const char kPrefsOmahaEolStatus[] = "omaha-eol-status"; 56 const char kPrefsP2PEnabled[] = "p2p-enabled"; 57 const char kPrefsP2PFirstAttemptTimestamp[] = "p2p-first-attempt-timestamp"; 58 const char kPrefsP2PNumAttempts[] = "p2p-num-attempts"; 59 const char kPrefsPayloadAttemptNumber[] = "payload-attempt-number"; 60 const char kPrefsPreviousVersion[] = "previous-version"; 61 const char kPrefsResumedUpdateFailures[] = "resumed-update-failures"; 62 const char kPrefsRollbackVersion[] = "rollback-version"; 63 const char kPrefsChannelOnSlotPrefix[] = "channel-on-slot-"; 64 const char kPrefsSystemUpdatedMarker[] = "system-updated-marker"; 65 const char kPrefsTargetVersionAttempt[] = "target-version-attempt"; 66 const char kPrefsTargetVersionInstalledFrom[] = "target-version-installed-from"; 67 const char kPrefsTargetVersionUniqueId[] = "target-version-unique-id"; 68 const char kPrefsTotalBytesDownloaded[] = "total-bytes-downloaded"; 69 const char kPrefsUpdateCheckCount[] = "update-check-count"; 70 const char kPrefsUpdateCheckResponseHash[] = "update-check-response-hash"; 71 const char kPrefsUpdateCompletedBootTime[] = "update-completed-boot-time"; 72 const char kPrefsUpdateCompletedOnBootId[] = "update-completed-on-boot-id"; 73 const char kPrefsUpdateDurationUptime[] = "update-duration-uptime"; 74 const char kPrefsUpdateFirstSeenAt[] = "update-first-seen-at"; 75 const char kPrefsUpdateOverCellularPermission[] = 76 "update-over-cellular-permission"; 77 const char kPrefsUpdateServerCertificate[] = "update-server-cert"; 78 const char kPrefsUpdateStateNextDataLength[] = "update-state-next-data-length"; 79 const char kPrefsUpdateStateNextDataOffset[] = "update-state-next-data-offset"; 80 const char kPrefsUpdateStateNextOperation[] = "update-state-next-operation"; 81 const char kPrefsUpdateStatePayloadIndex[] = "update-state-payload-index"; 82 const char kPrefsUpdateStateSHA256Context[] = "update-state-sha-256-context"; 83 const char kPrefsUpdateStateSignatureBlob[] = "update-state-signature-blob"; 84 const char kPrefsUpdateStateSignedSHA256Context[] = 85 "update-state-signed-sha-256-context"; 86 const char kPrefsUpdateTimestampStart[] = "update-timestamp-start"; 87 const char kPrefsUrlSwitchCount[] = "url-switch-count"; 88 const char kPrefsWallClockWaitPeriod[] = "wall-clock-wait-period"; 89 90 // These four fields are generated by scripts/brillo_update_payload. 91 const char kPayloadPropertyFileSize[] = "FILE_SIZE"; 92 const char kPayloadPropertyFileHash[] = "FILE_HASH"; 93 const char kPayloadPropertyMetadataSize[] = "METADATA_SIZE"; 94 const char kPayloadPropertyMetadataHash[] = "METADATA_HASH"; 95 // The Authorization: HTTP header to be sent when downloading the payload. 96 const char kPayloadPropertyAuthorization[] = "AUTHORIZATION"; 97 // The User-Agent HTTP header to be sent when downloading the payload. 98 const char kPayloadPropertyUserAgent[] = "USER_AGENT"; 99 // Set "POWERWASH=1" to powerwash (factory data reset) the device after 100 // applying the update. 101 const char kPayloadPropertyPowerwash[] = "POWERWASH"; 102 // The network id to pass to android_setprocnetwork before downloading. 103 // This can be used to zero-rate OTA traffic by sending it over the correct 104 // network. 105 const char kPayloadPropertyNetworkId[] = "NETWORK_ID"; 106 107 } // namespace chromeos_update_engine 108