Alex Deymo | aea4c1c | 2015-08-19 20:24:43 -0700 | [diff] [blame] | 1 | // |
| 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 Deymo | 161c4a1 | 2014-05-16 15:56:21 -0700 | [diff] [blame] | 16 | |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 17 | #ifndef UPDATE_ENGINE_PAYLOAD_CONSUMER_PAYLOAD_CONSTANTS_H_ |
| 18 | #define UPDATE_ENGINE_PAYLOAD_CONSUMER_PAYLOAD_CONSTANTS_H_ |
Alex Deymo | 161c4a1 | 2014-05-16 15:56:21 -0700 | [diff] [blame] | 19 | |
Ben Chan | 05735a1 | 2014-09-03 07:48:22 -0700 | [diff] [blame] | 20 | #include <stdint.h> |
| 21 | |
| 22 | #include <limits> |
Alex Deymo | 161c4a1 | 2014-05-16 15:56:21 -0700 | [diff] [blame] | 23 | |
Alex Deymo | 2d621a3 | 2015-10-01 11:09:01 -0700 | [diff] [blame] | 24 | #include "update_engine/update_metadata.pb.h" |
| 25 | |
Alex Deymo | 161c4a1 | 2014-05-16 15:56:21 -0700 | [diff] [blame] | 26 | namespace chromeos_update_engine { |
| 27 | |
Alex Deymo | cbf0989 | 2015-09-11 16:13:16 -0700 | [diff] [blame] | 28 | // The major version used by Chrome OS. |
Amin Hassani | 822d485 | 2020-03-10 01:50:42 +0000 | [diff] [blame] | 29 | // extern const uint64_t kChromeOSMajorPayloadVersion; DEPRECATED |
Alex Deymo | cbf0989 | 2015-09-11 16:13:16 -0700 | [diff] [blame] | 30 | |
| 31 | // The major version used by Brillo. |
| 32 | extern const uint64_t kBrilloMajorPayloadVersion; |
| 33 | |
Sen Jiang | dcaf797 | 2018-05-11 16:03:23 -0700 | [diff] [blame] | 34 | // The minimum and maximum supported major version. |
| 35 | extern const uint64_t kMinSupportedMajorPayloadVersion; |
| 36 | extern const uint64_t kMaxSupportedMajorPayloadVersion; |
| 37 | |
Alex Deymo | cbf0989 | 2015-09-11 16:13:16 -0700 | [diff] [blame] | 38 | // The minor version used for all full payloads. |
| 39 | extern const uint32_t kFullPayloadMinorVersion; |
| 40 | |
| 41 | // The minor version used by the in-place delta generator algorithm. |
Amin Hassani | 0f59a9a | 2019-09-27 10:24:31 -0700 | [diff] [blame] | 42 | // extern const uint32_t kInPlaceMinorPayloadVersion; DEPRECATED |
Alex Deymo | cbf0989 | 2015-09-11 16:13:16 -0700 | [diff] [blame] | 43 | |
| 44 | // The minor version used by the A to B delta generator algorithm. |
| 45 | extern const uint32_t kSourceMinorPayloadVersion; |
| 46 | |
Sen Jiang | 82352f9 | 2015-11-09 16:36:53 -0800 | [diff] [blame] | 47 | // The minor version that allows per-operation source hash. |
| 48 | extern const uint32_t kOpSrcHashMinorPayloadVersion; |
| 49 | |
Amin Hassani | 77d7cbc | 2018-02-07 16:21:33 -0800 | [diff] [blame] | 50 | // The minor version that allows BROTLI_BSDIFF, ZERO and DISCARD operation. |
| 51 | extern const uint32_t kBrotliBsdiffMinorPayloadVersion; |
| 52 | |
Amin Hassani | 5ef5d45 | 2017-08-04 13:10:59 -0700 | [diff] [blame] | 53 | // The minor version that allows PUFFDIFF operation. |
| 54 | extern const uint32_t kPuffdiffMinorPayloadVersion; |
Alex Deymo | cbf0989 | 2015-09-11 16:13:16 -0700 | [diff] [blame] | 55 | |
Sen Jiang | 3a4dfac | 2018-08-30 16:57:38 -0700 | [diff] [blame] | 56 | // The minor version that allows Verity hash tree and FEC generation. |
| 57 | extern const uint32_t kVerityMinorPayloadVersion; |
| 58 | |
Tianjie | f5baff4 | 2020-07-17 21:43:22 -0700 | [diff] [blame] | 59 | // The minor version that allows partial update, e.g. kernel only update. |
| 60 | extern const uint32_t kPartialUpdateMinorPayloadVersion; |
| 61 | |
Tianjie | c700169 | 2021-08-26 16:06:05 -0700 | [diff] [blame] | 62 | // The minor version that allows ZUCCHINI operation. |
| 63 | extern const uint32_t kZucchiniMinorPayloadVersion; |
| 64 | |
Kelvin Zhang | f67dc49 | 2021-12-08 15:35:31 -0800 | [diff] [blame] | 65 | // THe minor version that allows LZ4DIFF operation |
| 66 | constexpr uint32_t kLZ4DIFFMinorPayloadVersion = 9; |
| 67 | |
Sen Jiang | dcaf797 | 2018-05-11 16:03:23 -0700 | [diff] [blame] | 68 | // The minimum and maximum supported minor version. |
| 69 | extern const uint32_t kMinSupportedMinorPayloadVersion; |
| 70 | extern const uint32_t kMaxSupportedMinorPayloadVersion; |
| 71 | |
Sen Jiang | b5f601d | 2018-02-02 13:51:21 -0800 | [diff] [blame] | 72 | // The maximum size of the payload header (anything before the protobuf). |
| 73 | extern const uint64_t kMaxPayloadHeaderSize; |
| 74 | |
Sen Jiang | 70a6ab0 | 2015-08-28 13:23:27 -0700 | [diff] [blame] | 75 | // 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 Brindus | dda79e2 | 2018-06-28 18:03:21 -0700 | [diff] [blame] | 78 | extern const char kPartitionNameKernel[]; |
| 79 | extern const char kPartitionNameRoot[]; |
Sen Jiang | 70a6ab0 | 2015-08-28 13:23:27 -0700 | [diff] [blame] | 80 | |
Alex Deymo | 161c4a1 | 2014-05-16 15:56:21 -0700 | [diff] [blame] | 81 | extern const char kBspatchPath[]; |
Sen Jiang | b8060e4 | 2015-09-24 17:30:50 -0700 | [diff] [blame] | 82 | extern const char kDeltaMagic[4]; |
Alex Deymo | 161c4a1 | 2014-05-16 15:56:21 -0700 | [diff] [blame] | 83 | |
| 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 Chan | 05735a1 | 2014-09-03 07:48:22 -0700 | [diff] [blame] | 86 | const uint64_t kSparseHole = std::numeric_limits<uint64_t>::max(); |
Alex Deymo | 161c4a1 | 2014-05-16 15:56:21 -0700 | [diff] [blame] | 87 | |
Alex Deymo | 2d621a3 | 2015-10-01 11:09:01 -0700 | [diff] [blame] | 88 | // Return the name of the operation type. |
Sen Jiang | cebb688 | 2019-02-26 16:23:28 +0800 | [diff] [blame] | 89 | const char* InstallOperationTypeName(InstallOperation::Type op_type); |
Alex Deymo | 2d621a3 | 2015-10-01 11:09:01 -0700 | [diff] [blame] | 90 | |
Ben Chan | 05735a1 | 2014-09-03 07:48:22 -0700 | [diff] [blame] | 91 | } // namespace chromeos_update_engine |
Alex Deymo | 161c4a1 | 2014-05-16 15:56:21 -0700 | [diff] [blame] | 92 | |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 93 | #endif // UPDATE_ENGINE_PAYLOAD_CONSUMER_PAYLOAD_CONSTANTS_H_ |