This commit is contained in:
parent
57e06dcc99
commit
b352a7bc43
6 changed files with 75 additions and 20 deletions
|
@ -2,6 +2,8 @@ use std::fmt::Display;
|
|||
|
||||
use serde::Deserialize;
|
||||
|
||||
use crate::install::drives::partition_disk;
|
||||
|
||||
/// Declarative install configuration
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct InstallConfig {
|
||||
|
@ -61,14 +63,28 @@ pub struct PackageConfig {
|
|||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct DriveConfig {
|
||||
/// Disk Path (using entire disk)
|
||||
pub disk: Option<String>,
|
||||
/// Boot Drive Path
|
||||
pub boot: String,
|
||||
pub boot: Option<String>,
|
||||
/// Root Drive Path
|
||||
pub root: String,
|
||||
pub root: Option<String>,
|
||||
/// Enable encryption on root
|
||||
pub encryption: Option<String>,
|
||||
}
|
||||
|
||||
impl DriveConfig {
|
||||
pub fn use_entire_disk(&mut self) {
|
||||
if self.disk.is_some() {
|
||||
partition_disk(&self.disk.as_ref().unwrap());
|
||||
|
||||
// TODO : assign two children to root / boot the right way
|
||||
self.boot = Some(format!("{}1", self.disk.as_ref().unwrap()));
|
||||
self.root = Some(format!("{}2", self.disk.as_ref().unwrap()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct GeneralConfig {
|
||||
/// Presets
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue