summaryrefslogtreecommitdiff
path: root/fs_mgr/libsnapshot/update_engine/update_metadata.proto
blob: 69d72e19cfbcafc80138383ec64cf67752d8f824 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//
// Copyright (C) 2020 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

// A subset of system/update_engine/update_metadata.proto. A separate file is
// used here because:
// - The original file is optimized for LITE_RUNTIME, but fuzzing needs
// reflection.
// - The definition here has less fields. libsnapshot only uses fields declared
// here, and all fields declared here are fuzzed by libsnapshot_fuzzer. If
// libsnapshot uses more fields in system/update_engine/update_metadata.proto
// in the future, they must be added here too, otherwise it will fail to
// compile.
//
// It is okay that this file is older than
// system/update_engine/update_metadata.proto as long as the messages defined
// here can also be parsed by protobuf defined there. However, it is not
// okay to add fields here without adding them to
// system/update_engine/update_metadata.proto. Doing so will cause a compiler
// error when libsnapshot code starts to use these dangling fields.

syntax = "proto2";

package chromeos_update_engine;

message Extent {
    optional uint64 start_block = 1;
    optional uint64 num_blocks = 2;
}

message PartitionInfo {
    optional uint64 size = 1;
}

message InstallOperation {
    enum Type {
        SOURCE_COPY = 4;
        // Not used by libsnapshot. Declared here so that the fuzzer has an
        // alternative value to use for |type|.
        ZERO = 6;
    }
    required Type type = 1;
    repeated Extent src_extents = 4;
    repeated Extent dst_extents = 6;
}

message PartitionUpdate {
    required string partition_name = 1;
    optional PartitionInfo new_partition_info = 7;
    repeated InstallOperation operations = 8;
    optional Extent hash_tree_extent = 11;
    optional Extent fec_extent = 15;
    optional uint64 estimate_cow_size = 19;
}

message DynamicPartitionGroup {
    required string name = 1;
    optional uint64 size = 2;
    repeated string partition_names = 3;
}

message DynamicPartitionMetadata {
    repeated DynamicPartitionGroup groups = 1;
    optional bool vabc_enabled = 3;
    optional string vabc_compression_param = 4;
    optional uint32 cow_version = 5;
}

message DeltaArchiveManifest {
    repeated PartitionUpdate partitions = 13;
    optional DynamicPartitionMetadata dynamic_partition_metadata = 15;
    optional bool partial_update = 16;
}