blob: 31e24f79c7c76148e7e77f62afbf1c420da4707c [file] [log] [blame]
Alex Deymoaea4c1c2015-08-19 20:24:43 -07001//
2// Copyright (C) 2014 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//
Alex Deymo161c4a12014-05-16 15:56:21 -070016
Alex Deymo39910dc2015-11-09 17:04:30 -080017#ifndef UPDATE_ENGINE_PAYLOAD_CONSUMER_PAYLOAD_CONSTANTS_H_
18#define UPDATE_ENGINE_PAYLOAD_CONSUMER_PAYLOAD_CONSTANTS_H_
Alex Deymo161c4a12014-05-16 15:56:21 -070019
Ben Chan05735a12014-09-03 07:48:22 -070020#include <stdint.h>
21
22#include <limits>
Alex Deymo161c4a12014-05-16 15:56:21 -070023
Alex Deymo2d621a32015-10-01 11:09:01 -070024#include "update_engine/update_metadata.pb.h"
25
Alex Deymo161c4a12014-05-16 15:56:21 -070026namespace chromeos_update_engine {
27
Alex Deymocbf09892015-09-11 16:13:16 -070028// The major version used by Chrome OS.
Amin Hassani822d4852020-03-10 01:50:42 +000029// extern const uint64_t kChromeOSMajorPayloadVersion; DEPRECATED
Alex Deymocbf09892015-09-11 16:13:16 -070030
31// The major version used by Brillo.
32extern const uint64_t kBrilloMajorPayloadVersion;
33
Sen Jiangdcaf7972018-05-11 16:03:23 -070034// The minimum and maximum supported major version.
35extern const uint64_t kMinSupportedMajorPayloadVersion;
36extern const uint64_t kMaxSupportedMajorPayloadVersion;
37
Alex Deymocbf09892015-09-11 16:13:16 -070038// The minor version used for all full payloads.
39extern const uint32_t kFullPayloadMinorVersion;
40
41// The minor version used by the in-place delta generator algorithm.
Amin Hassani0f59a9a2019-09-27 10:24:31 -070042// extern const uint32_t kInPlaceMinorPayloadVersion; DEPRECATED
Alex Deymocbf09892015-09-11 16:13:16 -070043
44// The minor version used by the A to B delta generator algorithm.
45extern const uint32_t kSourceMinorPayloadVersion;
46
Sen Jiang82352f92015-11-09 16:36:53 -080047// The minor version that allows per-operation source hash.
48extern const uint32_t kOpSrcHashMinorPayloadVersion;
49
Amin Hassani77d7cbc2018-02-07 16:21:33 -080050// The minor version that allows BROTLI_BSDIFF, ZERO and DISCARD operation.
51extern const uint32_t kBrotliBsdiffMinorPayloadVersion;
52
Amin Hassani5ef5d452017-08-04 13:10:59 -070053// The minor version that allows PUFFDIFF operation.
54extern const uint32_t kPuffdiffMinorPayloadVersion;
Alex Deymocbf09892015-09-11 16:13:16 -070055
Sen Jiang3a4dfac2018-08-30 16:57:38 -070056// The minor version that allows Verity hash tree and FEC generation.
57extern const uint32_t kVerityMinorPayloadVersion;
58
Tianjief5baff42020-07-17 21:43:22 -070059// The minor version that allows partial update, e.g. kernel only update.
60extern const uint32_t kPartialUpdateMinorPayloadVersion;
61
Tianjiec7001692021-08-26 16:06:05 -070062// The minor version that allows ZUCCHINI operation.
63extern const uint32_t kZucchiniMinorPayloadVersion;
64
Kelvin Zhangf67dc492021-12-08 15:35:31 -080065// THe minor version that allows LZ4DIFF operation
66constexpr uint32_t kLZ4DIFFMinorPayloadVersion = 9;
67
Sen Jiangdcaf7972018-05-11 16:03:23 -070068// The minimum and maximum supported minor version.
69extern const uint32_t kMinSupportedMinorPayloadVersion;
70extern const uint32_t kMaxSupportedMinorPayloadVersion;
71
Sen Jiangb5f601d2018-02-02 13:51:21 -080072// The maximum size of the payload header (anything before the protobuf).
73extern const uint64_t kMaxPayloadHeaderSize;
74
Sen Jiang70a6ab02015-08-28 13:23:27 -070075// The kernel and rootfs partition names used by the BootControlInterface when
76// handling update payloads with a major version 1. The names of the updated
77// partitions are include in the payload itself for major version 2.
Tudor Brindusdda79e22018-06-28 18:03:21 -070078extern const char kPartitionNameKernel[];
79extern const char kPartitionNameRoot[];
Sen Jiang70a6ab02015-08-28 13:23:27 -070080
Alex Deymo161c4a12014-05-16 15:56:21 -070081extern const char kBspatchPath[];
Sen Jiangb8060e42015-09-24 17:30:50 -070082extern const char kDeltaMagic[4];
Alex Deymo161c4a12014-05-16 15:56:21 -070083
84// A block number denoting a hole on a sparse file. Used on Extents to refer to
85// section of blocks not present on disk on a sparse file.
Ben Chan05735a12014-09-03 07:48:22 -070086const uint64_t kSparseHole = std::numeric_limits<uint64_t>::max();
Alex Deymo161c4a12014-05-16 15:56:21 -070087
Alex Deymo2d621a32015-10-01 11:09:01 -070088// Return the name of the operation type.
Sen Jiangcebb6882019-02-26 16:23:28 +080089const char* InstallOperationTypeName(InstallOperation::Type op_type);
Alex Deymo2d621a32015-10-01 11:09:01 -070090
Ben Chan05735a12014-09-03 07:48:22 -070091} // namespace chromeos_update_engine
Alex Deymo161c4a12014-05-16 15:56:21 -070092
Alex Deymo39910dc2015-11-09 17:04:30 -080093#endif // UPDATE_ENGINE_PAYLOAD_CONSUMER_PAYLOAD_CONSTANTS_H_