Skip to main content

FirmwareBackend

Trait FirmwareBackend 

Source
pub trait FirmwareBackend {
    type Verified;

    // Required methods
    fn capabilities(&self) -> Capabilities;
    fn begin(&mut self, size: u64, metadata: &[u8]) -> Result<(), Error>;
    fn write(&mut self, bytes: &[u8]) -> Result<usize, Error>;
    fn finish(&mut self) -> Result<Self::Verified, Error>;
    fn activate(&mut self, verified: Self::Verified) -> Result<(), Error>;
    fn abort(&mut self) -> Result<(), Error>;
    fn confirm_running(&mut self) -> Result<(), Error>;
}
Expand description

Implementations own image format, trust roots, staging geometry and persistent boot state. Never return success before accepted bytes are durable according to the platform contract. finish authenticates readback; its nonforgeable proof must bind the exact staging generation. activate must reject stale proofs and mutations since verification. Abort must never clear pending boot.

No VFS, allocator, transport, scheduler or signing key is required here.

Required Associated Types§

Required Methods§

Source

fn capabilities(&self) -> Capabilities

Source

fn begin(&mut self, size: u64, metadata: &[u8]) -> Result<(), Error>

Source

fn write(&mut self, bytes: &[u8]) -> Result<usize, Error>

Source

fn finish(&mut self) -> Result<Self::Verified, Error>

Source

fn activate(&mut self, verified: Self::Verified) -> Result<(), Error>

Source

fn abort(&mut self) -> Result<(), Error>

Source

fn confirm_running(&mut self) -> Result<(), Error>

Implementors§