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 kPrefsDynamicPartitionMetadataUpdated[] = 41 "dynamic-partition-metadata-updated"; 42 const char kPrefsFullPayloadAttemptNumber[] = "full-payload-attempt-number"; 43 const char kPrefsInstallDateDays[] = "install-date-days"; 44 const char kPrefsLastActivePingDay[] = "last-active-ping-day"; 45 const char kPrefsLastRollCallPingDay[] = "last-roll-call-ping-day"; 46 const char kPrefsManifestMetadataSize[] = "manifest-metadata-size"; 47 const char kPrefsManifestSignatureSize[] = "manifest-signature-size"; 48 const char kPrefsMetricsAttemptLastReportingTime[] = 49 "metrics-attempt-last-reporting-time"; 50 const char kPrefsMetricsCheckLastReportingTime[] = 51 "metrics-check-last-reporting-time"; 52 const char kPrefsNoIgnoreBackoff[] = "no-ignore-backoff"; 53 const char kPrefsNumReboots[] = "num-reboots"; 54 const char kPrefsNumResponsesSeen[] = "num-responses-seen"; 55 const char kPrefsOmahaCohort[] = "omaha-cohort"; 56 const char kPrefsOmahaCohortHint[] = "omaha-cohort-hint"; 57 const char kPrefsOmahaCohortName[] = "omaha-cohort-name"; 58 const char kPrefsOmahaEolStatus[] = "omaha-eol-status"; 59 const char kPrefsP2PEnabled[] = "p2p-enabled"; 60 const char kPrefsP2PFirstAttemptTimestamp[] = "p2p-first-attempt-timestamp"; 61 const char kPrefsP2PNumAttempts[] = "p2p-num-attempts"; 62 const char kPrefsPayloadAttemptNumber[] = "payload-attempt-number"; 63 const char kPrefsPostInstallSucceeded[] = "post-install-succeeded"; 64 const char kPrefsPreviousVersion[] = "previous-version"; 65 const char kPrefsResumedUpdateFailures[] = "resumed-update-failures"; 66 const char kPrefsRollbackHappened[] = "rollback-happened"; 67 const char kPrefsRollbackVersion[] = "rollback-version"; 68 const char kPrefsChannelOnSlotPrefix[] = "channel-on-slot-"; 69 const char kPrefsSystemUpdatedMarker[] = "system-updated-marker"; 70 const char kPrefsTargetVersionAttempt[] = "target-version-attempt"; 71 const char kPrefsTargetVersionInstalledFrom[] = "target-version-installed-from"; 72 const char kPrefsTargetVersionUniqueId[] = "target-version-unique-id"; 73 const char kPrefsTotalBytesDownloaded[] = "total-bytes-downloaded"; 74 const char kPrefsUpdateCheckCount[] = "update-check-count"; 75 const char kPrefsUpdateCheckResponseHash[] = "update-check-response-hash"; 76 const char kPrefsUpdateCompletedBootTime[] = "update-completed-boot-time"; 77 const char kPrefsUpdateCompletedOnBootId[] = "update-completed-on-boot-id"; 78 const char kPrefsUpdateDurationUptime[] = "update-duration-uptime"; 79 const char kPrefsUpdateFirstSeenAt[] = "update-first-seen-at"; 80 const char kPrefsUpdateOverCellularPermission[] = 81 "update-over-cellular-permission"; 82 const char kPrefsUpdateOverCellularTargetVersion[] = 83 "update-over-cellular-target-version"; 84 const char kPrefsUpdateOverCellularTargetSize[] = 85 "update-over-cellular-target-size"; 86 const char kPrefsUpdateServerCertificate[] = "update-server-cert"; 87 const char kPrefsUpdateStateNextDataLength[] = "update-state-next-data-length"; 88 const char kPrefsUpdateStateNextDataOffset[] = "update-state-next-data-offset"; 89 const char kPrefsUpdateStateNextOperation[] = "update-state-next-operation"; 90 const char kPrefsUpdateStatePayloadIndex[] = "update-state-payload-index"; 91 const char kPrefsUpdateStateSHA256Context[] = "update-state-sha-256-context"; 92 const char kPrefsUpdateStateSignatureBlob[] = "update-state-signature-blob"; 93 const char kPrefsUpdateStateSignedSHA256Context[] = 94 "update-state-signed-sha-256-context"; 95 const char kPrefsUpdateBootTimestampStart[] = "update-boot-timestamp-start"; 96 const char kPrefsUpdateTimestampStart[] = "update-timestamp-start"; 97 const char kPrefsUrlSwitchCount[] = "url-switch-count"; 98 const char kPrefsVerityWritten[] = "verity-written"; 99 const char kPrefsWallClockScatteringWaitPeriod[] = "wall-clock-wait-period"; 100 const char kPrefsWallClockStagingWaitPeriod[] = 101 "wall-clock-staging-wait-period"; 102 103 // These four fields are generated by scripts/brillo_update_payload. 104 const char kPayloadPropertyFileSize[] = "FILE_SIZE"; 105 const char kPayloadPropertyFileHash[] = "FILE_HASH"; 106 const char kPayloadPropertyMetadataSize[] = "METADATA_SIZE"; 107 const char kPayloadPropertyMetadataHash[] = "METADATA_HASH"; 108 // The Authorization: HTTP header to be sent when downloading the payload. 109 const char kPayloadPropertyAuthorization[] = "AUTHORIZATION"; 110 // The User-Agent HTTP header to be sent when downloading the payload. 111 const char kPayloadPropertyUserAgent[] = "USER_AGENT"; 112 // Set "POWERWASH=1" to powerwash (factory data reset) the device after 113 // applying the update. 114 const char kPayloadPropertyPowerwash[] = "POWERWASH"; 115 // The network id to pass to android_setprocnetwork before downloading. 116 // This can be used to zero-rate OTA traffic by sending it over the correct 117 // network. 118 const char kPayloadPropertyNetworkId[] = "NETWORK_ID"; 119 // Set "SWITCH_SLOT_ON_REBOOT=0" to skip marking the updated partitions active. 120 // The default is 1 (always switch slot if update succeeded). 121 const char kPayloadPropertySwitchSlotOnReboot[] = "SWITCH_SLOT_ON_REBOOT"; 122 // Set "RUN_POST_INSTALL=0" to skip running optional post install. 123 // The default is 1 (always run post install). 124 const char kPayloadPropertyRunPostInstall[] = "RUN_POST_INSTALL"; 125 126 } // namespace chromeos_update_engine 127