From beae6be5cf632834ee30dce6b9712f5a912df0c4 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Sat, 4 Jan 2025 23:01:25 +0100 Subject: [PATCH] fix --- src/install/drives.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/install/drives.rs b/src/install/drives.rs index b5c3086..e95bde2 100644 --- a/src/install/drives.rs +++ b/src/install/drives.rs @@ -12,10 +12,18 @@ pub fn format_drives(conf: &DriveConfig) { // ROOT if let Some(pass) = &conf.encryption { run_command( - &["cryptsetup", "luksFormat", conf.root.as_str()], - Some(&format!("YES\n{pass}\n{pass}\n")), - true, + &["cryptsetup", "-q", "luksFormat", conf.root.as_str()], + Some(&format!("{pass}\n")), + false, ); + + run_command( + &["cryptsetup", "open", conf.root.as_str(), "root"], + Some(&format!("{pass}\n")), + false, + ); + + run_command(&["mkfs.ext4", "/dev/mapper/root"], None, false); } else { run_command(&["mkfs.ext4", conf.root.as_str()], None, false); } @@ -25,13 +33,7 @@ pub fn format_drives(conf: &DriveConfig) { /// Mount the drives at `/mnt` pub fn mount_drives(conf: &DriveConfig) { - if let Some(pass) = &conf.encryption { - run_command( - &["cryptsetup", "open", conf.root.as_str(), "root"], - Some(&format!("{pass}\n")), - true, - ); - + if conf.encryption.is_some() { run_command(&["mount", "/dev/mapper/root", "/mnt"], None, false); } else { run_command(&["mount", conf.root.as_str(), "/mnt"], None, false);