feat(orchestrator,cli,config,fs): implement 3 modes, CLI-first precedence, kernel topo, defaults

- Orchestrator:
  - Add mutually exclusive modes: --mount-existing, --report-current, --apply
  - Wire mount-existing/report-current flows and JSON summaries
  - Reuse mount planning/application; never mount ESP
  - Context builders for new flags
  (see: src/orchestrator/run.rs:1)

- CLI:
  - Add --mount-existing and --report-current flags
  - Keep -t/--topology (ValueEnum) as before
  (see: src/cli/args.rs:1)

- FS:
  - Implement probe_existing_filesystems() using blkid to detect ZOSDATA/ZOSBOOT and dedupe by UUID
  (see: src/fs/plan.rs:1)

- Config loader:
  - Precedence now: CLI flags > kernel cmdline (zosstorage.topo) > built-in defaults
  - Read kernel cmdline topology only if CLI didn’t set -t/--topology
  - Default topology set to DualIndependent
  - Do not read /etc config by default in initramfs
  (see: src/config/loader.rs:1)

- Main:
  - Wire new Context builder flags
  (see: src/main.rs:1)

Rationale:
- Enables running from in-kernel initramfs with no config file
- Topology can be selected via kernel cmdline (zosstorage.topo) or CLI; CLI has priority
This commit is contained in:
2025-09-30 16:16:51 +02:00
parent b0d8c0bc75
commit d374176c0b
5 changed files with 336 additions and 44 deletions

View File

@@ -52,6 +52,8 @@ fn real_main() -> Result<()> {
let ctx = orchestrator::Context::new(cfg, log_opts)
.with_show(cli.show)
.with_apply(cli.apply)
.with_mount_existing(cli.mount_existing)
.with_report_current(cli.report_current)
.with_report_path(cli.report.clone());
orchestrator::run(&ctx)
}