blob: ad193a0844fe862c0c59ba5c748fcc9e60456699 [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#include "update_engine/payload_consumer/payload_constants.h"
Alex Deymo161c4a12014-05-16 15:56:21 -070018
19namespace chromeos_update_engine {
20
Alex Deymocbf09892015-09-11 16:13:16 -070021const uint64_t kChromeOSMajorPayloadVersion = 1;
22const uint64_t kBrilloMajorPayloadVersion = 2;
23
24const uint32_t kFullPayloadMinorVersion = 0;
25const uint32_t kInPlaceMinorPayloadVersion = 1;
26const uint32_t kSourceMinorPayloadVersion = 2;
Sen Jiang82352f92015-11-09 16:36:53 -080027const uint32_t kOpSrcHashMinorPayloadVersion = 3;
Amin Hassani5ef5d452017-08-04 13:10:59 -070028const uint32_t kPuffdiffMinorPayloadVersion = 4;
Alex Deymocbf09892015-09-11 16:13:16 -070029
Sen Jiang70a6ab02015-08-28 13:23:27 -070030const char kLegacyPartitionNameKernel[] = "boot";
31const char kLegacyPartitionNameRoot[] = "system";
32
Sen Jiangb8060e42015-09-24 17:30:50 -070033const char kDeltaMagic[4] = {'C', 'r', 'A', 'U'};
Alex Deymo161c4a12014-05-16 15:56:21 -070034
Alex Deymo2d621a32015-10-01 11:09:01 -070035const char* InstallOperationTypeName(InstallOperation_Type op_type) {
36 switch (op_type) {
37 case InstallOperation::BSDIFF:
38 return "BSDIFF";
39 case InstallOperation::MOVE:
40 return "MOVE";
41 case InstallOperation::REPLACE:
42 return "REPLACE";
43 case InstallOperation::REPLACE_BZ:
44 return "REPLACE_BZ";
45 case InstallOperation::SOURCE_COPY:
46 return "SOURCE_COPY";
47 case InstallOperation::SOURCE_BSDIFF:
48 return "SOURCE_BSDIFF";
49 case InstallOperation::ZERO:
50 return "ZERO";
51 case InstallOperation::DISCARD:
52 return "DISCARD";
53 case InstallOperation::REPLACE_XZ:
54 return "REPLACE_XZ";
Amin Hassani5ef5d452017-08-04 13:10:59 -070055 case InstallOperation::PUFFDIFF:
56 return "PUFFDIFF";
Amin Hassaniefa62d92017-11-09 13:46:56 -080057 case InstallOperation::BROTLI_BSDIFF:
58 return "BROTLI_BSDIFF";
Alex Deymo2d621a32015-10-01 11:09:01 -070059 }
60 return "<unknown_op>";
61}
62
Alex Deymo161c4a12014-05-16 15:56:21 -070063}; // namespace chromeos_update_engine