[pve-devel] [PATCH installer v6 33/36] auto-installer: utils: define ISO specified settings

Aaron Lauterer a.lauterer at proxmox.com
Wed Apr 17 14:31:05 CEST 2024


These will be expected on the ISO itself and define the behavior of the
automated installation.

Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
 proxmox-auto-installer/src/utils.rs | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/proxmox-auto-installer/src/utils.rs b/proxmox-auto-installer/src/utils.rs
index ff90ae8..997ab34 100644
--- a/proxmox-auto-installer/src/utils.rs
+++ b/proxmox-auto-installer/src/utils.rs
@@ -1,4 +1,5 @@
 use anyhow::{bail, Result};
+use clap::ValueEnum;
 use glob::Pattern;
 use log::info;
 use std::{
@@ -14,7 +15,7 @@ use proxmox_installer_common::{
     options::{FsType, NetworkOptions, ZfsChecksumOption, ZfsCompressOption},
     setup::{InstallConfig, InstallZfsOption, LocaleInfo, RuntimeInfo, SetupInfo},
 };
-use serde::Deserialize;
+use serde::{Deserialize, Serialize};
 
 fn find_with_glob(pattern: &str, value: &str) -> Result<bool> {
     let p = Pattern::new(pattern)?;
@@ -72,6 +73,23 @@ pub fn get_single_udev_index(
     Ok(dev_index.unwrap())
 }
 
+#[derive(Deserialize, Serialize, Debug, Clone, ValueEnum, PartialEq)]
+#[serde(rename_all = "lowercase", deny_unknown_fields)]
+pub enum AutoInstModes {
+    Auto,
+    Included,
+    Http,
+    Partition,
+}
+
+#[derive(Deserialize, Serialize, Debug)]
+#[serde(rename_all = "lowercase", deny_unknown_fields)]
+pub struct AutoInstSettings {
+    pub mode: AutoInstModes,
+    pub http_url: Option<String>,
+    pub cert_fingerprint: Option<String>,
+}
+
 #[derive(Deserialize, Debug)]
 struct IpLinksUdevInfo {
     ifname: String,
-- 
2.39.2





More information about the pve-devel mailing list