forked from lix-project/lix-installer
When user sets encrypted, detect it, else heuristic
This commit is contained in:
parent
67efbedae9
commit
7b8c62e4d5
|
@ -25,7 +25,7 @@ pub struct DarwinMulti {
|
||||||
default_value = "false",
|
default_value = "false",
|
||||||
env = "HARMONIC_ENCRYPT"
|
env = "HARMONIC_ENCRYPT"
|
||||||
)]
|
)]
|
||||||
pub encrypt: bool,
|
pub encrypt: Option<bool>,
|
||||||
/// Use a case sensitive volume
|
/// Use a case sensitive volume
|
||||||
#[clap(
|
#[clap(
|
||||||
long,
|
long,
|
||||||
|
@ -58,7 +58,7 @@ impl Planner for DarwinMulti {
|
||||||
settings: CommonSettings::default()?,
|
settings: CommonSettings::default()?,
|
||||||
root_disk: Some(default_root_disk().await?),
|
root_disk: Some(default_root_disk().await?),
|
||||||
case_sensitive: false,
|
case_sensitive: false,
|
||||||
encrypt: false,
|
encrypt: None,
|
||||||
volume_label: "Nix Store".into(),
|
volume_label: "Nix Store".into(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -81,15 +81,17 @@ impl Planner for DarwinMulti {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if self.encrypt == false {
|
let encrypt = if self.encrypt == None {
|
||||||
self.encrypt = Command::new("/usr/bin/fdesetup")
|
Command::new("/usr/bin/fdesetup")
|
||||||
.arg("isactive")
|
.arg("isactive")
|
||||||
.status()
|
.status()
|
||||||
.await?
|
.await?
|
||||||
.code()
|
.code()
|
||||||
.map(|v| if v == 0 { false } else { true })
|
.map(|v| if v == 0 { false } else { true })
|
||||||
.unwrap_or(false)
|
.unwrap_or(false)
|
||||||
}
|
} else {
|
||||||
|
false
|
||||||
|
};
|
||||||
|
|
||||||
Ok(InstallPlan {
|
Ok(InstallPlan {
|
||||||
planner: Box::new(self.clone()),
|
planner: Box::new(self.clone()),
|
||||||
|
@ -103,7 +105,7 @@ impl Planner for DarwinMulti {
|
||||||
self.root_disk.unwrap(), /* We just ensured it was populated */
|
self.root_disk.unwrap(), /* We just ensured it was populated */
|
||||||
self.volume_label,
|
self.volume_label,
|
||||||
false,
|
false,
|
||||||
self.encrypt,
|
encrypt,
|
||||||
)
|
)
|
||||||
.await?,
|
.await?,
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue