From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer v2 1/4] auto-install-assistant: add new parameter to specify partition label
Date: Fri, 8 Nov 2024 14:05:33 +0100 [thread overview]
Message-ID: <20241108130537.1266472-2-c.heiss@proxmox.com> (raw)
In-Reply-To: <20241108130537.1266472-1-c.heiss@proxmox.com>
.. for the 'partition' fetch method.
Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-By: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
Changes v1 -> v2:
* dropped useless "proxmox-ais" explanation from --prepare-iso
command description
proxmox-auto-install-assistant/src/main.rs | 12 ++++++++++--
proxmox-auto-installer/src/utils.rs | 1 +
proxmox-fetch-answer/src/main.rs | 1 +
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/proxmox-auto-install-assistant/src/main.rs b/proxmox-auto-install-assistant/src/main.rs
index 1447175..5d11882 100644
--- a/proxmox-auto-install-assistant/src/main.rs
+++ b/proxmox-auto-install-assistant/src/main.rs
@@ -94,8 +94,7 @@ 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 ('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 +109,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 +143,11 @@ struct CommandPrepareISO {
/// input ISO file.
#[arg(long)]
tmp: Option<String>,
+
+ /// 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 +330,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<AutoInstSettings> {
}
Ok(AutoInstSettings {
mode,
+ partition_label: "proxmox-ais".to_owned(),
http: HttpOptions {
url: args.get(2).cloned(),
cert_fingerprint: args.get(3).cloned(),
--
2.47.0
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2024-11-08 13:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-08 13:05 [pve-devel] [PATCH installer v2 0/4] auto-install-assistant: allow specifying 'fetch-from' " Christoph Heiss
2024-11-08 13:05 ` Christoph Heiss [this message]
2024-11-08 13:05 ` [pve-devel] [PATCH installer v2 2/4] fetch-answer: refactor cli argument parsing Christoph Heiss
2024-11-08 13:05 ` [pve-devel] [PATCH installer v2 3/4] fetch-answer: partition: also search for exact-matching partition label Christoph Heiss
2024-11-08 13:05 ` [pve-devel] [PATCH installer v2 4/4] fetch-answer: use partition label from fetch config instead of hardcoded Christoph Heiss
2024-11-10 18:23 ` [pve-devel] applied-series: [PATCH installer v2 0/4] auto-install-assistant: allow specifying 'fetch-from' partition label Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241108130537.1266472-2-c.heiss@proxmox.com \
--to=c.heiss@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.