From 5b7cd2a5650fd53870eb468ce5ca6345fa34ed11 Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Sat, 11 Sep 2021 20:57:07 -0600 Subject: [PATCH] dont set guid until setup is complete --- appmgr/src/setup.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/appmgr/src/setup.rs b/appmgr/src/setup.rs index 1cc4d36f5..718417ace 100644 --- a/appmgr/src/setup.rs +++ b/appmgr/src/setup.rs @@ -23,7 +23,6 @@ pub struct StatusRes { #[command(rpc_only)] pub fn status() -> Result { - // TODO Ok(StatusRes { is_recovering: false, tor_address: None, @@ -45,9 +44,6 @@ pub async fn execute( let guid = crate::disk::main::create(&ctx.zfs_pool_name, [embassy_logicalname], DEFAULT_PASSWORD) .await?; - tokio::fs::write("/embassy-os/disk.guid", &guid) - .await - .with_ctx(|_| (crate::ErrorKind::Filesystem, "/embassy-os/disk.guid"))?; crate::disk::main::load(&guid, &ctx.zfs_pool_name, &ctx.datadir, DEFAULT_PASSWORD).await?; let password = argon2::hash_encoded( embassy_password.as_bytes(), @@ -66,6 +62,9 @@ pub async fn execute( ) .execute(&mut sqlite_pool.acquire().await?) .await?; + tokio::fs::write("/embassy-os/disk.guid", &guid) + .await + .with_ctx(|_| (crate::ErrorKind::Filesystem, "/embassy-os/disk.guid"))?; Ok(SetupResult { tor_address: tor_key.public().get_onion_address().to_string(),