entire disk
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
JMARyA 2025-04-09 13:52:33 +02:00
parent 57e06dcc99
commit b352a7bc43
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
6 changed files with 75 additions and 20 deletions

View file

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