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    /// The sha256 hash of the raw image with no padding.
40    #[prost(bytes="vec", tag="4")]
41    pub sha256: ::prost::alloc::vec::Vec<u8>,
42    /// Metadata about the blob containing the image data.
43    #[prost(message, optional, tag="5")]
44    pub blob: ::core::option::Option<Blob>,
45    /// The type of the image.
46    #[prost(oneof="image::ImageType", tags="1, 2")]
47    pub image_type: ::core::option::Option<image::ImageType>,
48}
49/// Nested message and enum types in `Image`.
50pub mod image {
51    /// The type of the image.
52    #[derive(Clone, PartialEq, ::prost::Oneof)]
53    pub enum ImageType {
54        /// A standard system asset like ZBI or VBMETA.
55        #[prost(enumeration="super::AssetType", tag="1")]
56        Asset(i32),
57        /// A firmware image, with the field value specifying the firmware type.
58        #[prost(string, tag="2")]
59        Firmware(::prost::alloc::string::String),
60    }
61}
62/// Metadata for a blob.
63#[derive(Clone, PartialEq, ::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/// A list of Ed25519 signatures.
73#[derive(Clone, PartialEq, ::prost::Message)]
74pub struct Signatures {
75    #[prost(bytes="vec", repeated, tag="1")]
76    pub signatures: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
77}
78/// The mode of the update.
79#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
80#[repr(i32)]
81pub enum UpdateMode {
82    /// A standard system update.
83    Normal = 0,
84    /// An update that forces the device into recovery mode.
85    ForceRecovery = 1,
86}
87impl UpdateMode {
88    /// String value of the enum field names used in the ProtoBuf definition.
89    ///
90    /// The values are not transformed in any way and thus are considered stable
91    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
92    pub fn as_str_name(&self) -> &'static str {
93        match self {
94            UpdateMode::Normal => "NORMAL",
95            UpdateMode::ForceRecovery => "FORCE_RECOVERY",
96        }
97    }
98}
99/// The target slot for an image.
100#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
101#[repr(i32)]
102pub enum Slot {
103    /// The primary A/B slot.
104    Ab = 0,
105    /// The recovery slot.
106    R = 1,
107}
108impl Slot {
109    /// String value of the enum field names used in the ProtoBuf definition.
110    ///
111    /// The values are not transformed in any way and thus are considered stable
112    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
113    pub fn as_str_name(&self) -> &'static str {
114        match self {
115            Slot::Ab => "AB",
116            Slot::R => "R",
117        }
118    }
119}
120/// The type of a system asset.
121#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
122#[repr(i32)]
123pub enum AssetType {
124    /// A Zircon Boot Image.
125    Zbi = 0,
126    /// Verified Boot Metadata.
127    Vbmeta = 1,
128}
129impl AssetType {
130    /// String value of the enum field names used in the ProtoBuf definition.
131    ///
132    /// The values are not transformed in any way and thus are considered stable
133    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
134    pub fn as_str_name(&self) -> &'static str {
135        match self {
136            AssetType::Zbi => "ZBI",
137            AssetType::Vbmeta => "VBMETA",
138        }
139    }
140}