mount: prefer boot disk ESP and run cargo fmt

* choose ESP matching the primary data disk when multiple ESPs exist,
  falling back gracefully for single-disk layouts
* keep new helper to normalize device names and reuse the idempotent
  mount logic
* apply cargo fmt across the tree
This commit is contained in:
2025-10-10 14:49:39 +02:00
parent 5746e285b2
commit 3d14f77516
23 changed files with 447 additions and 263 deletions

View File

@@ -85,24 +85,24 @@ pub struct Cli {
/// Include removable devices (e.g., USB sticks) during discovery (default: false)
#[arg(long = "allow-removable", default_value_t = false)]
pub allow_removable: bool,
/// Attempt to mount existing filesystems based on on-disk headers; no partitioning or mkfs.
/// Non-destructive mounting flow; uses UUID= sources and policy from config.
#[arg(long = "mount-existing", default_value_t = false)]
pub mount_existing: bool,
/// Report current initialized filesystems and mounts without performing changes.
#[arg(long = "report-current", default_value_t = false)]
pub report_current: bool,
/// Print detection and planning summary as JSON to stdout (non-default)
#[arg(long = "show", default_value_t = false)]
pub show: bool,
/// Write detection/planning JSON report to the given path
#[arg(long = "report")]
pub report: Option<String>,
/// Execute destructive actions (apply mode). When false, runs preview-only.
#[arg(long = "apply", default_value_t = false)]
pub apply: bool,
@@ -111,4 +111,4 @@ pub struct Cli {
/// Parse CLI arguments (non-interactive; suitable for initramfs).
pub fn from_args() -> Cli {
Cli::parse()
}
}