fix missing parent dir (#2373)

This commit is contained in:
Aiden McClelland
2023-07-25 10:07:10 -06:00
committed by GitHub
parent 8f44c75dc3
commit 082c51109d
2 changed files with 4 additions and 7 deletions

View File

@@ -109,6 +109,9 @@ pub async fn create_fs<P: AsRef<Path>>(
.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<P: AsRef<Path>>(
guid: &str,
datadir: P,
repair: RepairStrategy,
mut password: Option<&str>,
password: Option<&str>,
) -> Result<RequiresReboot, Error> {
let scan = pvscan().await?;
if scan

View File

@@ -1,6 +0,0 @@
os-partitions:
boot: /dev/mmcblk0p1
root: /dev/mmcblk0p2
ethernet-interface: end0
wifi-interface: wlan0
disable-encryption: true