From a0d39431e89dbe0a5e60932188a137697d950ee6 Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Wed, 30 Jan 2019 14:13:24 -0500 Subject: [PATCH] bless method added to mark partition which has booted successfully --- libcitadel/src/partition.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libcitadel/src/partition.rs b/libcitadel/src/partition.rs index 3b7e306..474303b 100644 --- a/libcitadel/src/partition.rs +++ b/libcitadel/src/partition.rs @@ -166,10 +166,17 @@ impl Partition { } 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 { - if Mount::is_path_mounted(path)? { + if Mount::is_source_mounted(path)? { return Ok(true); } let holders = count_block_holders(path)?;