public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Aaron Lauterer <a.lauterer@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Christoph Heiss <c.heiss@proxmox.com>
Subject: Re: [pve-devel] [PATCH installer 4/4] fetch-answer: use partition label from fetch config instead of hardcoded
Date: Thu, 7 Nov 2024 16:28:25 +0100	[thread overview]
Message-ID: <c41e3afc-de04-4f14-937f-6c8810b7fa25@proxmox.com> (raw)
In-Reply-To: <20241018115943.813243-5-c.heiss@proxmox.com>

only small nits inline

Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-By: Aaron Lauterer <a.lauterer@proxmox.com>

On  2024-10-18  13:59, Christoph Heiss wrote:
> This has been requested by at least one user one user [0] and definitely
> makes sense, esp. for BMCs/IPMIs where one might not be able to control
> the partition label.
> 
> [0] https://forum.proxmox.com/threads/proxmox-ais-question-request.153043/post-695689
> 
> Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
> ---
>   .../src/fetch_plugins/partition.rs            | 13 +++++------
>   proxmox-fetch-answer/src/main.rs              | 23 +++++++++++++------
>   2 files changed, 22 insertions(+), 14 deletions(-)
> 
> diff --git a/proxmox-fetch-answer/src/fetch_plugins/partition.rs b/proxmox-fetch-answer/src/fetch_plugins/partition.rs
> index cbfe2d5..c68dc59 100644
> --- a/proxmox-fetch-answer/src/fetch_plugins/partition.rs
> +++ b/proxmox-fetch-answer/src/fetch_plugins/partition.rs
> @@ -9,17 +9,16 @@ use std::{
>   static ANSWER_FILE: &str = "answer.toml";
>   static ANSWER_MP: &str = "/mnt/answer";
>   // FAT can only handle 11 characters, so shorten Automated Installer Source to AIS

this comment is now dangling. we could move that to the definition of 
the default value for the new parameter

> -static PARTLABEL: &str = "proxmox-ais";
>   static DISK_BY_ID_PATH: &str = "/dev/disk/by-label";
>   
>   pub struct FetchFromPartition;
>   
>   impl FetchFromPartition {
>       /// Returns the contents of the answer file
> -    pub fn get_answer() -> Result<String> {
> +    pub fn get_answer(part_label: &str) -> Result<String> {
>           info!("Checking for answer file on partition.");
>   
> -        let mut mount_path = PathBuf::from(mount_proxmoxinst_part()?);
> +        let mut mount_path = PathBuf::from(mount_proxmoxinst_part(part_label)?);
>           mount_path.push(ANSWER_FILE);
>           let answer = fs::read_to_string(mount_path)
>               .map_err(|err| format_err!("failed to read answer file - {err}"))?;
> @@ -74,14 +73,14 @@ fn scan_partlabels(partlabel: &str, search_path: &str) -> Result<PathBuf> {
>       bail!("Could not find partition for label '{partlabel}'");
>   }
>   
> -/// Will search and mount a partition/FS labeled PARTLABEL (proxmox-ais) in lower or uppercase
> -/// to ANSWER_MP
> -fn mount_proxmoxinst_part() -> Result<String> {
> +/// Will search and mount a partition/FS labeled labeled `part_label` in lower or uppercase to

one `labeled` too much :)

> +/// ANSWER_MP
> +fn mount_proxmoxinst_part(part_label: &str) -> Result<String> {
>       if let Ok(true) = check_if_mounted(ANSWER_MP) {
>           info!("Skipping: '{ANSWER_MP}' is already mounted.");[…]


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

  reply	other threads:[~2024-11-07 15:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18 11:59 [pve-devel] [PATCH installer 0/4] auto-install-assistant: allow specifying 'fetch-from' partition label Christoph Heiss
2024-10-18 11:59 ` [pve-devel] [PATCH installer 1/4] auto-install-assistant: add new parameter to specify " Christoph Heiss
2024-10-18 11:59 ` [pve-devel] [PATCH installer 2/4] fetch-answer: refactor cli argument parsing Christoph Heiss
2024-10-18 11:59 ` [pve-devel] [PATCH installer 3/4] fetch-answer: partition: also search for exact-matching partition label Christoph Heiss
2024-10-18 11:59 ` [pve-devel] [PATCH installer 4/4] fetch-answer: use partition label from fetch config instead of hardcoded Christoph Heiss
2024-11-07 15:28   ` Aaron Lauterer [this message]
2024-11-08  9:28     ` Christoph Heiss
2024-11-08  9:30       ` Aaron Lauterer
2024-11-08  9:48         ` Christoph Heiss
2024-11-07 15:29 ` [pve-devel] [PATCH installer 0/4] auto-install-assistant: allow specifying 'fetch-from' partition label Aaron Lauterer

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=c41e3afc-de04-4f14-937f-6c8810b7fa25@proxmox.com \
    --to=a.lauterer@proxmox.com \
    --cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal