blob: 9d29afd9d6860684b610b270684f25a0a7a468d2 [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.
29extern const uint64_t kChromeOSMajorPayloadVersion;
30
31// The major version used by Brillo.
32extern const uint64_t kBrilloMajorPayloadVersion;
33
34// The minor version used for all full payloads.
35extern const uint32_t kFullPayloadMinorVersion;
36
37// The minor version used by the in-place delta generator algorithm.
38extern const uint32_t kInPlaceMinorPayloadVersion;
39
40// The minor version used by the A to B delta generator algorithm.
41extern const uint32_t kSourceMinorPayloadVersion;
42
Sen Jiang82352f92015-11-09 16:36:53 -080043// The minor version that allows per-operation source hash.
44extern const uint32_t kOpSrcHashMinorPayloadVersion;
45
Amin Hassani77d7cbc2018-02-07 16:21:33 -080046// The minor version that allows BROTLI_BSDIFF, ZERO and DISCARD operation.
47extern const uint32_t kBrotliBsdiffMinorPayloadVersion;
48
Amin Hassani5ef5d452017-08-04 13:10:59 -070049// The minor version that allows PUFFDIFF operation.
50extern const uint32_t kPuffdiffMinorPayloadVersion;
Alex Deymocbf09892015-09-11 16:13:16 -070051
Sen Jiang70a6ab02015-08-28 13:23:27 -070052// The kernel and rootfs partition names used by the BootControlInterface when
53// handling update payloads with a major version 1. The names of the updated
54// partitions are include in the payload itself for major version 2.
55extern const char kLegacyPartitionNameKernel[];
56extern const char kLegacyPartitionNameRoot[];
57
Alex Deymo161c4a12014-05-16 15:56:21 -070058extern const char kBspatchPath[];
Sen Jiangb8060e42015-09-24 17:30:50 -070059extern const char kDeltaMagic[4];
Alex Deymo161c4a12014-05-16 15:56:21 -070060
61// A block number denoting a hole on a sparse file. Used on Extents to refer to
62// section of blocks not present on disk on a sparse file.
Ben Chan05735a12014-09-03 07:48:22 -070063const uint64_t kSparseHole = std::numeric_limits<uint64_t>::max();
Alex Deymo161c4a12014-05-16 15:56:21 -070064
Alex Deymo2d621a32015-10-01 11:09:01 -070065// Return the name of the operation type.
66const char* InstallOperationTypeName(InstallOperation_Type op_type);
67
Ben Chan05735a12014-09-03 07:48:22 -070068} // namespace chromeos_update_engine
Alex Deymo161c4a12014-05-16 15:56:21 -070069
Alex Deymo39910dc2015-11-09 17:04:30 -080070#endif // UPDATE_ENGINE_PAYLOAD_CONSUMER_PAYLOAD_CONSTANTS_H_