Skip to main content

ota_manifest_proto/
fuchsia.update.manifest.rs

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