1
0
forked from brl/citadel-tools

bless method added to mark partition which has booted successfully

This commit is contained in:
Bruce Leidl 2019-01-30 14:13:24 -05:00
parent c00e11ee8f
commit a0d39431e8

View File

@ -166,10 +166,17 @@ impl Partition {
} }
Ok(()) Ok(())
} }
pub fn bless(&mut self) -> Result<()> {
if self.header().status() == ImageHeader::STATUS_TRY_BOOT {
self.write_status(ImageHeader::STATUS_GOOD)?;
}
Ok(())
}
} }
fn is_in_use(path: &Path) -> Result<bool> { fn is_in_use(path: &Path) -> Result<bool> {
if Mount::is_path_mounted(path)? { if Mount::is_source_mounted(path)? {
return Ok(true); return Ok(true);
} }
let holders = count_block_holders(path)?; let holders = count_block_holders(path)?;