fix
Some checks failed
ci/woodpecker/push/build Pipeline failed

This commit is contained in:
JMARyA 2025-01-04 23:01:25 +01:00
parent 30e2db26ca
commit beae6be5cf
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263

View file

@ -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);