From 082c51109ddb8fd9f0577d783bbefb5e20cd617c Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Tue, 25 Jul 2023 10:07:10 -0600 Subject: [PATCH] fix missing parent dir (#2373) --- backend/src/disk/main.rs | 5 ++++- build/raspberrypi/config.yaml | 6 ------ 2 files changed, 4 insertions(+), 7 deletions(-) delete mode 100644 build/raspberrypi/config.yaml diff --git a/backend/src/disk/main.rs b/backend/src/disk/main.rs index 7d1ce1d3f..48b392236 100644 --- a/backend/src/disk/main.rs +++ b/backend/src/disk/main.rs @@ -109,6 +109,9 @@ pub async fn create_fs>( .await?; let mut blockdev_path = Path::new("/dev").join(guid).join(name); if let Some(password) = password { + if let Some(parent) = Path::new(PASSWORD_PATH).parent() { + tokio::fs::create_dir_all(parent).await?; + } tokio::fs::write(PASSWORD_PATH, password) .await .with_ctx(|_| (crate::ErrorKind::Filesystem, PASSWORD_PATH))?; @@ -207,7 +210,7 @@ pub async fn import>( guid: &str, datadir: P, repair: RepairStrategy, - mut password: Option<&str>, + password: Option<&str>, ) -> Result { let scan = pvscan().await?; if scan diff --git a/build/raspberrypi/config.yaml b/build/raspberrypi/config.yaml deleted file mode 100644 index 7c81ad513..000000000 --- a/build/raspberrypi/config.yaml +++ /dev/null @@ -1,6 +0,0 @@ -os-partitions: - boot: /dev/mmcblk0p1 - root: /dev/mmcblk0p2 -ethernet-interface: end0 -wifi-interface: wlan0 -disable-encryption: true