ota_manifest_proto/fuchsia.update.manifest.rs
1// This file is @generated by prost-build.
2/// The root message for an Over-The-Air (OTA) update manifest.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct OtaManifest {
5 /// The version of the product bundle. This field is for
6 /// informational purposes only and does not change the updater's behavior.
7 #[prost(string, tag = "1")]
8 pub product_bundle_version: ::prost::alloc::string::String,
9 /// The board this OTA is for (e.g., "x64", "arm64"). The system updater will
10 /// reject the OTA if this does not match the device's expected board name
11 /// from `build-info`.
12 #[prost(string, tag = "2")]
13 pub board: ::prost::alloc::string::String,
14 /// The epoch of this OTA. See RFC-0071 for details.
15 #[prost(uint64, tag = "3")]
16 pub epoch: u64,
17 /// The update mode, indicating if this is a normal update or a forced
18 /// recovery.
19 #[prost(enumeration = "UpdateMode", tag = "4")]
20 pub mode: i32,
21 /// The base URL prefix of the blobs, including the delivery blob type. The
22 /// final URL for each blob will be "{blob_base_url}/{fuchsia_merkle_root}".
23 /// Relative URLs are supported, and will be resolved relative to the URL of
24 /// the OTA manifest.
25 #[prost(string, tag = "5")]
26 pub blob_base_url: ::prost::alloc::string::String,
27 /// The partition images that should be written during the update.
28 #[prost(message, repeated, tag = "6")]
29 pub images: ::prost::alloc::vec::Vec<Image>,
30 /// Additional blobs that should be written to blob storage.
31 #[prost(message, repeated, tag = "7")]
32 pub blobs: ::prost::alloc::vec::Vec<Blob>,
33}
34/// An image to be written to a partition.
35#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
36pub struct Image {
37 /// The slot this image should be written to.
38 #[prost(enumeration = "Slot", tag = "3")]
39 pub slot: i32,
40 /// Metadata about the blob containing the image data.
41 #[prost(message, optional, tag = "4")]
42 pub blob: ::core::option::Option<Blob>,
43 /// The type of the image.
44 #[prost(oneof = "image::ImageType", tags = "1, 2")]
45 pub image_type: ::core::option::Option<image::ImageType>,
46}
47/// Nested message and enum types in `Image`.
48pub mod image {
49 /// The type of the image.
50 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
51 pub enum ImageType {
52 /// A standard system asset like ZBI or VBMETA.
53 #[prost(enumeration = "super::AssetType", tag = "1")]
54 Asset(i32),
55 /// A firmware image, with the field value specifying the board specific
56 /// firmware type, which will be passed to paver verbatim. If paver doesn't
57 /// support the firmware type, the firmware image will be skipped.
58 #[prost(string, tag = "2")]
59 Firmware(::prost::alloc::string::String),
60 }
61}
62/// Metadata for a blob.
63#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
64pub struct Blob {
65 /// The fuchsia merkle root of the uncompressed blob data.
66 #[prost(bytes = "vec", tag = "1")]
67 pub fuchsia_merkle_root: ::prost::alloc::vec::Vec<u8>,
68 /// The uncompressed size of the blob in bytes.
69 #[prost(uint64, tag = "2")]
70 pub uncompressed_size: u64,
71}
72/// Signatures containing the delegation chain: Root Key -> Manifest Key -> Manifest.
73#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
74pub struct Signatures {
75 /// The Ed25519 signature of the manifest, signed by the manifest key.
76 #[prost(bytes = "vec", tag = "1")]
77 pub manifest_signature: ::prost::alloc::vec::Vec<u8>,
78 /// The public key of the manifest signing key.
79 #[prost(bytes = "vec", tag = "2")]
80 pub manifest_public_key: ::prost::alloc::vec::Vec<u8>,
81 /// The Ed25519 signature of the manifest public key, signed by the root key.
82 #[prost(bytes = "vec", tag = "3")]
83 pub manifest_key_signature: ::prost::alloc::vec::Vec<u8>,
84}
85/// The mode of the update.
86#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
87#[repr(i32)]
88pub enum UpdateMode {
89 /// A standard system update.
90 Normal = 0,
91 /// An update that forces the device into recovery mode.
92 ForceRecovery = 1,
93}
94impl UpdateMode {
95 /// String value of the enum field names used in the ProtoBuf definition.
96 ///
97 /// The values are not transformed in any way and thus are considered stable
98 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
99 pub fn as_str_name(&self) -> &'static str {
100 match self {
101 Self::Normal => "NORMAL",
102 Self::ForceRecovery => "FORCE_RECOVERY",
103 }
104 }
105 /// Creates an enum from field names used in the ProtoBuf definition.
106 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
107 match value {
108 "NORMAL" => Some(Self::Normal),
109 "FORCE_RECOVERY" => Some(Self::ForceRecovery),
110 _ => None,
111 }
112 }
113}
114/// The target slot for an image.
115#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
116#[repr(i32)]
117pub enum Slot {
118 /// The primary A/B slot.
119 Ab = 0,
120 /// The recovery slot.
121 R = 1,
122}
123impl Slot {
124 /// String value of the enum field names used in the ProtoBuf definition.
125 ///
126 /// The values are not transformed in any way and thus are considered stable
127 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
128 pub fn as_str_name(&self) -> &'static str {
129 match self {
130 Self::Ab => "AB",
131 Self::R => "R",
132 }
133 }
134 /// Creates an enum from field names used in the ProtoBuf definition.
135 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
136 match value {
137 "AB" => Some(Self::Ab),
138 "R" => Some(Self::R),
139 _ => None,
140 }
141 }
142}
143/// The type of a system asset.
144#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
145#[repr(i32)]
146pub enum AssetType {
147 /// A Zircon Boot Image.
148 Zbi = 0,
149 /// Verified Boot Metadata.
150 Vbmeta = 1,
151}
152impl AssetType {
153 /// String value of the enum field names used in the ProtoBuf definition.
154 ///
155 /// The values are not transformed in any way and thus are considered stable
156 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
157 pub fn as_str_name(&self) -> &'static str {
158 match self {
159 Self::Zbi => "ZBI",
160 Self::Vbmeta => "VBMETA",
161 }
162 }
163 /// Creates an enum from field names used in the ProtoBuf definition.
164 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
165 match value {
166 "ZBI" => Some(Self::Zbi),
167 "VBMETA" => Some(Self::Vbmeta),
168 _ => None,
169 }
170 }
171}