fix ROFS error on os install (#2364)

This commit is contained in:
Aiden McClelland
2023-07-19 08:50:02 -06:00
committed by GitHub
parent c2db4390bb
commit 5f92f9e965

View File

@@ -149,7 +149,7 @@ pub async fn execute(
if !overwrite { if !overwrite {
if let Ok(guard) = if let Ok(guard) =
TmpMountGuard::mount(&BlockDev::new(part_info.root.clone()), MountType::ReadOnly).await TmpMountGuard::mount(&BlockDev::new(part_info.root.clone()), MountType::ReadWrite).await
{ {
if let Err(e) = async { if let Err(e) = async {
// cp -r ${guard}/config /tmp/config // cp -r ${guard}/config /tmp/config
@@ -171,13 +171,14 @@ pub async fn execute(
.arg("/tmp/config.bak") .arg("/tmp/config.bak")
.invoke(crate::ErrorKind::Filesystem) .invoke(crate::ErrorKind::Filesystem)
.await?; .await?;
guard.unmount().await Ok::<_, Error>(())
} }
.await .await
{ {
tracing::error!("Error recovering previous config: {e}"); tracing::error!("Error recovering previous config: {e}");
tracing::debug!("{e:?}"); tracing::debug!("{e:?}");
} }
guard.unmount().await?;
} }
} }