blob: 0677e663bb7c308ce2d043307240c0dbac3c2ba0 [file] [log] [blame]
Alex Deymoaea4c1c2015-08-19 20:24:43 -07001//
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 Srinivasan1c0fe792013-03-28 16:45:25 -070016
Alex Deymo39910dc2015-11-09 17:04:30 -080017#include "update_engine/common/constants.h"
Jay Srinivasan1c0fe792013-03-28 16:45:25 -070018
19namespace chromeos_update_engine {
20
Jae Hoon Kim38de3b12020-04-29 19:41:23 -070021const char kExclusionPrefsSubDir[] = "exclusion";
22
Andrew065d78d2020-04-07 15:43:07 -070023const char kDlcPrefsSubDir[] = "dlc";
Andrewe045aef2020-01-08 16:29:22 -080024
Alex Deymodd132f32015-09-14 19:12:07 -070025const char kPowerwashSafePrefsSubDirectory[] = "update_engine/prefs";
Chris Sosaaa18e162013-06-20 13:20:30 -070026
Alex Deymodd132f32015-09-14 19:12:07 -070027const char kPrefsSubDirectory[] = "prefs";
Chris Sosaaa18e162013-06-20 13:20:30 -070028
29const char kStatefulPartition[] = "/mnt/stateful_partition";
Jay Srinivasan1c0fe792013-03-28 16:45:25 -070030
Alex Deymo390efed2016-02-18 11:00:40 -080031const char kPostinstallDefaultScript[] = "postinst";
32
Jay Srinivasand29695d2013-04-08 15:08:05 -070033// Constants defining keys for the persisted state of update engine.
David Zeuthen4e1d1492014-04-25 13:12:27 -070034const char kPrefsAttemptInProgress[] = "attempt-in-progress";
Jay Srinivasand29695d2013-04-08 15:08:05 -070035const char kPrefsBackoffExpiryTime[] = "backoff-expiry-time";
Alex Deymodd132f32015-09-14 19:12:07 -070036const char kPrefsBootId[] = "boot-id";
Jay Srinivasan19409b72013-04-12 19:23:36 -070037const char kPrefsCurrentBytesDownloaded[] = "current-bytes-downloaded";
Jay Srinivasand29695d2013-04-08 15:08:05 -070038const char kPrefsCurrentResponseSignature[] = "current-response-signature";
39const char kPrefsCurrentUrlFailureCount[] = "current-url-failure-count";
40const char kPrefsCurrentUrlIndex[] = "current-url-index";
David Zeuthen985b1122013-10-09 12:13:15 -070041const char kPrefsDailyMetricsLastReportedAt[] =
42 "daily-metrics-last-reported-at";
Jay Srinivasand29695d2013-04-08 15:08:05 -070043const char kPrefsDeltaUpdateFailures[] = "delta-update-failures";
Tao Bao3406c772019-01-02 15:34:35 -080044const char kPrefsDynamicPartitionMetadataUpdated[] =
45 "dynamic-partition-metadata-updated";
Alex Deymo820cc702013-06-28 15:43:46 -070046const char kPrefsFullPayloadAttemptNumber[] = "full-payload-attempt-number";
David Zeuthen639aa362014-02-03 16:23:44 -080047const char kPrefsInstallDateDays[] = "install-date-days";
Jay Srinivasand29695d2013-04-08 15:08:05 -070048const char kPrefsLastActivePingDay[] = "last-active-ping-day";
49const char kPrefsLastRollCallPingDay[] = "last-roll-call-ping-day";
50const char kPrefsManifestMetadataSize[] = "manifest-metadata-size";
Alex Deymof25eb492016-02-26 00:20:08 -080051const char kPrefsManifestSignatureSize[] = "manifest-signature-size";
David Zeuthen33bae492014-02-25 16:16:18 -080052const char kPrefsMetricsAttemptLastReportingTime[] =
53 "metrics-attempt-last-reporting-time";
54const char kPrefsMetricsCheckLastReportingTime[] =
55 "metrics-check-last-reporting-time";
Amin Hassaniffb6d802018-03-30 11:43:57 -070056const char kPrefsNoIgnoreBackoff[] = "no-ignore-backoff";
Chris Sosabe45bef2013-04-09 18:25:12 -070057const char kPrefsNumReboots[] = "num-reboots";
David Zeuthena573d6f2013-06-14 16:13:36 -070058const char kPrefsNumResponsesSeen[] = "num-responses-seen";
Alex Deymo8e18f932015-03-27 16:16:59 -070059const char kPrefsOmahaCohort[] = "omaha-cohort";
60const char kPrefsOmahaCohortHint[] = "omaha-cohort-hint";
61const char kPrefsOmahaCohortName[] = "omaha-cohort-name";
Jae Hoon Kim051627a2019-09-03 12:56:32 -070062const char kPrefsOmahaEolDate[] = "omaha-eol-date";
David Zeuthen27a48bc2013-08-06 12:06:29 -070063const char kPrefsP2PEnabled[] = "p2p-enabled";
David Zeuthen639aa362014-02-03 16:23:44 -080064const char kPrefsP2PFirstAttemptTimestamp[] = "p2p-first-attempt-timestamp";
65const char kPrefsP2PNumAttempts[] = "p2p-num-attempts";
Jay Srinivasand29695d2013-04-08 15:08:05 -070066const char kPrefsPayloadAttemptNumber[] = "payload-attempt-number";
Amin Hassani03277de2020-07-28 12:32:49 -070067const char kPrefsTestUpdateCheckIntervalTimeout[] =
68 "test-update-check-interval-timeout";
Andrewe045aef2020-01-08 16:29:22 -080069// Keep |kPrefsPingActive| in sync with |kDlcMetadataFilePingActive| in
70// dlcservice.
71const char kPrefsPingActive[] = "active";
72const char kPrefsPingLastActive[] = "date_last_active";
73const char kPrefsPingLastRollcall[] = "date_last_rollcall";
Vyshu Khota4c5413d2020-11-04 16:17:25 -080074const char kPrefsLastFp[] = "last-fp";
Sen Jiang02c49422017-10-31 15:14:11 -070075const char kPrefsPostInstallSucceeded[] = "post-install-succeeded";
Jay Srinivasand29695d2013-04-08 15:08:05 -070076const char kPrefsPreviousVersion[] = "previous-version";
77const char kPrefsResumedUpdateFailures[] = "resumed-update-failures";
Marton Hunyadye58bddb2018-04-10 20:27:26 +020078const char kPrefsRollbackHappened[] = "rollback-happened";
Chris Sosaaa18e162013-06-20 13:20:30 -070079const char kPrefsRollbackVersion[] = "rollback-version";
Alex Deymo85616652015-10-15 18:48:31 -070080const char kPrefsChannelOnSlotPrefix[] = "channel-on-slot-";
David Zeuthene4c58bf2013-06-18 17:26:50 -070081const char kPrefsSystemUpdatedMarker[] = "system-updated-marker";
Alex Deymo42432912013-07-12 20:21:15 -070082const char kPrefsTargetVersionAttempt[] = "target-version-attempt";
83const char kPrefsTargetVersionInstalledFrom[] = "target-version-installed-from";
84const char kPrefsTargetVersionUniqueId[] = "target-version-unique-id";
Jay Srinivasan19409b72013-04-12 19:23:36 -070085const char kPrefsTotalBytesDownloaded[] = "total-bytes-downloaded";
Jay Srinivasand29695d2013-04-08 15:08:05 -070086const char kPrefsUpdateCheckCount[] = "update-check-count";
87const char kPrefsUpdateCheckResponseHash[] = "update-check-response-hash";
Alex Deymo906191f2015-10-12 12:22:44 -070088const char kPrefsUpdateCompletedBootTime[] = "update-completed-boot-time";
89const char kPrefsUpdateCompletedOnBootId[] = "update-completed-on-boot-id";
David Zeuthencc6f9962013-04-18 11:57:24 -070090const char kPrefsUpdateDurationUptime[] = "update-duration-uptime";
Jay Srinivasand29695d2013-04-08 15:08:05 -070091const char kPrefsUpdateFirstSeenAt[] = "update-first-seen-at";
Alex Deymof4867c42013-06-28 14:41:39 -070092const char kPrefsUpdateOverCellularPermission[] =
93 "update-over-cellular-permission";
Weidong Guo421ff332017-04-17 10:08:38 -070094const char kPrefsUpdateOverCellularTargetVersion[] =
95 "update-over-cellular-target-version";
96const char kPrefsUpdateOverCellularTargetSize[] =
97 "update-over-cellular-target-size";
Jay Srinivasand29695d2013-04-08 15:08:05 -070098const char kPrefsUpdateServerCertificate[] = "update-server-cert";
David Zeuthen41996ad2013-09-24 15:43:24 -070099const char kPrefsUpdateStateNextDataLength[] = "update-state-next-data-length";
David Zeuthen639aa362014-02-03 16:23:44 -0800100const char kPrefsUpdateStateNextDataOffset[] = "update-state-next-data-offset";
Jay Srinivasand29695d2013-04-08 15:08:05 -0700101const char kPrefsUpdateStateNextOperation[] = "update-state-next-operation";
Sen Jiang0affc2c2017-02-10 15:55:05 -0800102const char kPrefsUpdateStatePayloadIndex[] = "update-state-payload-index";
Jay Srinivasand29695d2013-04-08 15:08:05 -0700103const char kPrefsUpdateStateSHA256Context[] = "update-state-sha-256-context";
104const char kPrefsUpdateStateSignatureBlob[] = "update-state-signature-blob";
105const char kPrefsUpdateStateSignedSHA256Context[] =
106 "update-state-signed-sha-256-context";
Tianjie Xu2a0ea632018-08-06 12:59:23 -0700107const char kPrefsUpdateBootTimestampStart[] = "update-boot-timestamp-start";
David Zeuthen9a017f22013-04-11 16:10:26 -0700108const char kPrefsUpdateTimestampStart[] = "update-timestamp-start";
David Zeuthencc6f9962013-04-18 11:57:24 -0700109const char kPrefsUrlSwitchCount[] = "url-switch-count";
Sen Jiang3eeaf7d2018-10-11 13:55:32 -0700110const char kPrefsVerityWritten[] = "verity-written";
Adolfo Victoriad3a1e352018-07-16 11:40:47 -0700111const char kPrefsWallClockScatteringWaitPeriod[] = "wall-clock-wait-period";
112const char kPrefsWallClockStagingWaitPeriod[] =
113 "wall-clock-staging-wait-period";
Kelvin Zhangcc011d32020-07-10 18:20:08 -0400114const char kPrefsManifestBytes[] = "manifest-bytes";
Kelvin Zhang86603472021-05-11 12:16:27 -0400115const char kPrefsPreviousSlot[] = "previous-slot";
Jay Srinivasand29695d2013-04-08 15:08:05 -0700116
Elliott Hughesb1e3e3c2017-02-28 15:15:38 -0800117// These four fields are generated by scripts/brillo_update_payload.
Alex Deymo98e691c2016-02-04 21:05:45 -0800118const char kPayloadPropertyFileSize[] = "FILE_SIZE";
119const char kPayloadPropertyFileHash[] = "FILE_HASH";
120const char kPayloadPropertyMetadataSize[] = "METADATA_SIZE";
121const char kPayloadPropertyMetadataHash[] = "METADATA_HASH";
Elliott Hughesb1e3e3c2017-02-28 15:15:38 -0800122// The Authorization: HTTP header to be sent when downloading the payload.
Alex Deymofdd6dec2016-03-03 22:35:43 -0800123const char kPayloadPropertyAuthorization[] = "AUTHORIZATION";
Elliott Hughesb1e3e3c2017-02-28 15:15:38 -0800124// The User-Agent HTTP header to be sent when downloading the payload.
Alex Deymofdd6dec2016-03-03 22:35:43 -0800125const char kPayloadPropertyUserAgent[] = "USER_AGENT";
Elliott Hughesb1e3e3c2017-02-28 15:15:38 -0800126// Set "POWERWASH=1" to powerwash (factory data reset) the device after
127// applying the update.
Alex Deymofb905d92016-06-03 19:26:58 -0700128const char kPayloadPropertyPowerwash[] = "POWERWASH";
Elliott Hughesb1e3e3c2017-02-28 15:15:38 -0800129// 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 Deymo87792ea2016-07-25 15:40:36 -0700132const char kPayloadPropertyNetworkId[] = "NETWORK_ID";
Sen Jiang02c49422017-10-31 15:14:11 -0700133// Set "SWITCH_SLOT_ON_REBOOT=0" to skip marking the updated partitions active.
134// The default is 1 (always switch slot if update succeeded).
135const char kPayloadPropertySwitchSlotOnReboot[] = "SWITCH_SLOT_ON_REBOOT";
Tianjie Xu087de9d2019-11-01 17:11:22 -0700136// Set "RUN_POST_INSTALL=0" to skip running optional post install.
Sen Jiang02c49422017-10-31 15:14:11 -0700137// The default is 1 (always run post install).
138const char kPayloadPropertyRunPostInstall[] = "RUN_POST_INSTALL";
Alex Deymo98e691c2016-02-04 21:05:45 -0800139
Amin Hassani7fca2862019-03-28 16:09:22 -0700140const char kOmahaUpdaterVersion[] = "0.1.0.0";
141
Jae Hoon Kim0ae8fe12019-06-26 14:32:50 -0700142// X-Goog-Update headers.
143const char kXGoogleUpdateInteractivity[] = "X-Goog-Update-Interactivity";
144const char kXGoogleUpdateAppId[] = "X-Goog-Update-AppId";
145const char kXGoogleUpdateUpdater[] = "X-Goog-Update-Updater";
146const char kXGoogleUpdateSessionId[] = "X-Goog-SessionId";
147
Alex Vakulenkod2779df2014-06-16 13:19:00 -0700148} // namespace chromeos_update_engine