From 1ddef5e7a85c4e7608a8abf6e6cf4cfa893a81c3 Mon Sep 17 00:00:00 2001 From: axtloss Date: Sat, 30 Jul 2022 13:39:07 +0200 Subject: [PATCH] Fix issue with unmounted /mnt/dev resolves #12 --- src/functions/partition.rs | 2 +- src/internal/install.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/functions/partition.rs b/src/functions/partition.rs index a094f4a..5be84d3 100755 --- a/src/functions/partition.rs +++ b/src/functions/partition.rs @@ -785,7 +785,7 @@ pub fn mount(partition: &str, mountpoint: &str, options: &str) { } } -fn umount(mountpoint: &str) { +pub fn umount(mountpoint: &str) { exec_eval( exec("umount", vec![String::from(mountpoint)]), format!("unmount {}", mountpoint).as_str(), diff --git a/src/internal/install.rs b/src/internal/install.rs index b15d13a..7d94d43 100755 --- a/src/internal/install.rs +++ b/src/internal/install.rs @@ -1,4 +1,6 @@ use crate::internal::*; +use crate::functions::partition::mount; +use crate::functions::partition::umount; use std::process::Command; pub fn install(pkgs: Vec<&str>) { @@ -6,4 +8,5 @@ pub fn install(pkgs: Vec<&str>) { Command::new("pacstrap").arg("/mnt").args(&pkgs).status(), format!("Install packages {}", pkgs.join(", ")).as_str(), ); + umount("/mnt/dev"); }