From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id CBD4D1FF15E for ; Fri, 18 Oct 2024 13:59:47 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1F033318D3; Fri, 18 Oct 2024 14:00:23 +0200 (CEST) From: Christoph Heiss To: pve-devel@lists.proxmox.com Date: Fri, 18 Oct 2024 13:59:37 +0200 Message-ID: <20241018115943.813243-2-c.heiss@proxmox.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241018115943.813243-1-c.heiss@proxmox.com> References: <20241018115943.813243-1-c.heiss@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.029 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [main.rs, utils.rs] Subject: [pve-devel] [PATCH installer 1/4] auto-install-assistant: add new parameter to specify partition label X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" .. for the 'partition' fetch method. Signed-off-by: Christoph Heiss --- proxmox-auto-install-assistant/src/main.rs | 13 +++++++++++-- proxmox-auto-installer/src/utils.rs | 1 + proxmox-fetch-answer/src/main.rs | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/proxmox-auto-install-assistant/src/main.rs b/proxmox-auto-install-assistant/src/main.rs index 1447175..1f29a45 100644 --- a/proxmox-auto-install-assistant/src/main.rs +++ b/proxmox-auto-install-assistant/src/main.rs @@ -94,8 +94,8 @@ struct CommandValidateAnswer { /// The behavior of how to fetch an answer file must be set with the '--fetch-from' parameter. The /// answer file can be:{n} /// * integrated into the ISO itself ('iso'){n} -/// * present on a partition / file-system with the label 'PROXMOX-AIS' (Proxmox -/// Automated Installer Source) ('partition'){n} +/// * present on a partition / file-system, matched by its label (Proxmox Automated Installer +/// Source) ('partition'){n} /// * requested via an HTTP Post request ('http'). /// /// The URL for the HTTP mode can be defined for the ISO with the '--url' argument. If not present, @@ -110,6 +110,9 @@ struct CommandValidateAnswer { /// to retrieve the URL. For example, the DNS TXT record for the fingerprint will only be used, if /// no one was configured with the '--cert-fingerprint' parameter and if the URL was retrieved via /// the DNS TXT record. +/// +/// If the 'partition' mode is used, the '--partition-label' parameter can be used to set the +/// partition label the auto-installer should search for. This defaults to 'proxmox-ais'. #[derive(Args, Debug)] struct CommandPrepareISO { /// Path to the source ISO to prepare @@ -141,6 +144,11 @@ struct CommandPrepareISO { /// input ISO file. #[arg(long)] tmp: Option, + + /// Can be used in combination with `--fetch-from partition` to set the partition label + /// the auto-installer will search for. + #[arg(long, default_value_t = { "proxmox-ais".to_owned() } )] + partition_label: String, } /// Show the system information that can be used to identify a host. @@ -323,6 +331,7 @@ fn prepare_iso(args: &CommandPrepareISO) -> Result<()> { println!("Preparing ISO..."); let config = AutoInstSettings { mode: args.fetch_from.clone(), + partition_label: args.partition_label.clone(), http: HttpOptions { url: args.url.clone(), cert_fingerprint: args.cert_fingerprint.clone(), diff --git a/proxmox-auto-installer/src/utils.rs b/proxmox-auto-installer/src/utils.rs index 45ad222..8ff8134 100644 --- a/proxmox-auto-installer/src/utils.rs +++ b/proxmox-auto-installer/src/utils.rs @@ -86,6 +86,7 @@ pub struct HttpOptions { #[serde(rename_all = "lowercase", deny_unknown_fields)] pub struct AutoInstSettings { pub mode: FetchAnswerFrom, + pub partition_label: String, #[serde(default)] pub http: HttpOptions, } diff --git a/proxmox-fetch-answer/src/main.rs b/proxmox-fetch-answer/src/main.rs index 660dc51..86c3270 100644 --- a/proxmox-fetch-answer/src/main.rs +++ b/proxmox-fetch-answer/src/main.rs @@ -63,6 +63,7 @@ fn settings_from_cli_args(args: &[String]) -> Result { } Ok(AutoInstSettings { mode, + partition_label: "proxmox-ais".to_owned(), http: HttpOptions { url: args.get(2).cloned(), cert_fingerprint: args.get(3).cloned(), -- 2.46.0 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel