pub struct PreparedUpdate { /* private fields */ }Expand description
An update validated against the installed firmware, ready to write.
Implementations§
Source§impl PreparedUpdate
impl PreparedUpdate
Sourcepub fn flash<R, W, H>(
&self,
io: FlashTransport<'_, R, W>,
runtime: &mut H,
) -> Result<Verified, FlashError<W::Error>>
pub fn flash<R, W, H>( &self, io: FlashTransport<'_, R, W>, runtime: &mut H, ) -> Result<Verified, FlashError<W::Error>>
Write the update and prove it: PROBE, TEST UNIT READY, PREPARE, the transfer in STREAM chunks, COMMIT, TEST UNIT READY and REQUEST SENSE; then poll TEST UNIT READY until the drive has programmed, REQUEST SENSE again, and read back every chunk, comparing the integrity-protected ranges with the image.
First capture a backup, enforce tray and consent policy and exclude other users of the drive. A failure stops at once; nothing is retried.
Source§impl PreparedUpdate
impl PreparedUpdate
Sourcepub fn check(image: &[u8], drive: &Identity) -> Result<Family, PrepareError>
pub fn check(image: &[u8], drive: &Identity) -> Result<Family, PrepareError>
Every check that needs no installed firmware, in order: size, integrity, raw drive read, chip against the drive and the image’s own hardware family. Returns that family.
Run it before capturing a backup; PreparedUpdate::prepare repeats
it.
Sourcepub fn prepare(
image: &[u8],
installed: &InstalledFirmware,
) -> Result<Self, PrepareError>
pub fn prepare( image: &[u8], installed: &InstalledFirmware, ) -> Result<Self, PrepareError>
Prepare image for the drive installed describes: Self::check
against its identity, then the family gate. Both families must be known
and equal.
Sourcepub fn encrypted(self) -> Self
pub fn encrypted(self) -> Self
Stream the AES-128-ECB transport envelope instead of the plaintext. Read-back still compares the plaintext the drive stores.
Sourcepub fn class(&self) -> DriveClass
pub fn class(&self) -> DriveClass
The update dialect.
Sourcepub fn steps(&self) -> Vec<Step>
pub fn steps(&self) -> Vec<Step>
The commands of the update session; see DriveClass::steps.
Sourcepub fn verification_ranges(&self) -> Vec<RangeInclusive<usize>>
pub fn verification_ranges(&self) -> Vec<RangeInclusive<usize>>
The ranges read-back verification compares; see
DriveClass::verification_ranges.