• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 //
16 
17 #include "update_engine/payload_consumer/payload_constants.h"
18 
19 namespace chromeos_update_engine {
20 
21 const uint64_t kChromeOSMajorPayloadVersion = 1;
22 const uint64_t kBrilloMajorPayloadVersion = 2;
23 
24 const uint32_t kMinSupportedMinorPayloadVersion = 1;
25 const uint32_t kMaxSupportedMinorPayloadVersion = 6;
26 
27 const uint32_t kFullPayloadMinorVersion = 0;
28 const uint32_t kInPlaceMinorPayloadVersion = 1;
29 const uint32_t kSourceMinorPayloadVersion = 2;
30 const uint32_t kOpSrcHashMinorPayloadVersion = 3;
31 const uint32_t kBrotliBsdiffMinorPayloadVersion = 4;
32 const uint32_t kPuffdiffMinorPayloadVersion = 5;
33 const uint32_t kVerityMinorPayloadVersion = 6;
34 
35 const uint64_t kMinSupportedMajorPayloadVersion = 1;
36 const uint64_t kMaxSupportedMajorPayloadVersion = 2;
37 
38 const uint64_t kMaxPayloadHeaderSize = 24;
39 
40 const char kPartitionNameKernel[] = "kernel";
41 const char kPartitionNameRoot[] = "root";
42 
43 const char kDeltaMagic[4] = {'C', 'r', 'A', 'U'};
44 
InstallOperationTypeName(InstallOperation::Type op_type)45 const char* InstallOperationTypeName(InstallOperation::Type op_type) {
46   switch (op_type) {
47     case InstallOperation::BSDIFF:
48       return "BSDIFF";
49     case InstallOperation::MOVE:
50       return "MOVE";
51     case InstallOperation::REPLACE:
52       return "REPLACE";
53     case InstallOperation::REPLACE_BZ:
54       return "REPLACE_BZ";
55     case InstallOperation::SOURCE_COPY:
56       return "SOURCE_COPY";
57     case InstallOperation::SOURCE_BSDIFF:
58       return "SOURCE_BSDIFF";
59     case InstallOperation::ZERO:
60       return "ZERO";
61     case InstallOperation::DISCARD:
62       return "DISCARD";
63     case InstallOperation::REPLACE_XZ:
64       return "REPLACE_XZ";
65     case InstallOperation::PUFFDIFF:
66       return "PUFFDIFF";
67     case InstallOperation::BROTLI_BSDIFF:
68       return "BROTLI_BSDIFF";
69   }
70   return "<unknown_op>";
71 }
72 
73 };  // namespace chromeos_update_engine
74