Skip to content

Expose provisioning profile inputs in human-readable --list output - #284

Merged
jetm merged 3 commits into
mainfrom
usb-provision-device-flag
Sep 24, 2026
Merged

jetm merged 3 commits into
mainfrom
usb-provision-device-flag

Conversation

@jetm

@jetm jetm commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

avocado provision --list's human-readable output showed a profile's name and script and nothing else. A profile's env-backed input fields (label, description, type, required/optional, and how to supply each with --env) were only visible in the JSON branch, so discovering what a profile actually needs meant reading the manifest by hand.

Solution

Extended the human-readable branch of --list to resolve and print each profile's fields the same way the JSON branch already does: field name, type, required/optional, the label and/or description when set, and an --env NAME=<value> hint for supplying it.

An earlier version of this PR added a dedicated --usb-device flag for the tegraflash-usb profile specifically. That approach was dropped: the generic --env/provision.fields mechanism already covers it, and a per-profile flag doesn't generalize to any other profile that declares fields. This PR is now the discoverability fix alone - showing what --env values a profile accepts - not a new flag.

Key changes

  • src/commands/profiles.rs: --list's human branch now resolves each profile's fields via resolve_profile_fields (the same helper the JSON branch uses) and prints them under the profile line
  • Label and description are shown together when both are set, whichever one is set when only one is, or neither when the field carries no metadata

Reviewer notes

Field declaration for tegraflash-usb itself (the manifest-side provision.fields entries) is a separate change in the target's own manifest, not part of this repo - avocado-linux/meta-avocado#407. This PR is the CLI-side display change only and has no dependency on that PR merging first.

`avocado provision --profile tegraflash-usb` had no way to name which
disk to provision except the generic `--env AVOCADO_PROVISION_USB_DEVICE=sda`
passthrough, which works but isn't discoverable in --help and gives no
indication the USB profile needs a device at all.

Added a dedicated --usb-device flag that folds into AVOCADO_PROVISION_USB_DEVICE
the same way --profile already folds into AVOCADO_PROVISION_PROFILE in
build_env_vars. Named it usb-device rather than device: Deploy already
has a --device/-d flag meaning a network host (user@host:port), and reusing
that name for a local block-device name on a sibling subcommand would read
as the same flag with different semantics. Depends on the tegraflash-usb
profile itself (avocado-linux/meta-avocado#407, not yet merged) - the flag
is inert until that profile exists on the other end.

Signed-off-by: Javier Tia <javier@peridio.com>
Comment thread src/main.rs Outdated
The --usb-device flag added a generic CLI flag for an input only one
NVIDIA provisioning profile consumes. --profile selects an extensible
procedure declared by the target's manifest; --usb-device exposed one
procedure's particular input as if it were a general concept, which
overstates its applicability to every other target's provisioning
profiles.

Removed the flag and its wiring from both provision commands and
build_env_vars. AVOCADO_PROVISION_USB_DEVICE reaches the same profile
through the existing generic mechanism: --env
AVOCADO_PROVISION_USB_DEVICE=sda, with metadata declared in the
target's own provision.fields (a manifest-repo change, not this one).

To close the discoverability gap the flag was meant to solve, extended
avocado provision --list's human-readable branch to print each
profile's resolved fields (type, required/optional, and label or
description) alongside the --env invocation to supply them. The JSON
branch already resolved this metadata for the desktop app; the human
branch printed only the profile name and script.

Signed-off-by: Javier Tia <javier@peridio.com>
@jetm
jetm requested a review from lee-reinhardt September 22, 2026 22:55
Comment thread src/commands/profiles.rs Outdated
Nit from review on avocado provision --list's human-readable branch:
`label.or(description)` dropped the description whenever a label was
also set, even though the two carry different information -
BOARDCTL_TARGET's label is "boardctl target" while its description
explains what leaving the field empty does, guidance the CLI was
silently discarding.

Print the label alongside the field name/type as before, and add the
description on its own line underneath when present, before the
--env hint. Handles label-only and description-only fields without
dropping either.

Signed-off-by: Javier Tia <javier@peridio.com>
@jetm
jetm requested a review from lee-reinhardt September 23, 2026 15:36
Comment thread src/commands/profiles.rs
@jetm jetm changed the title Add --usb-device flag for USB boot-media provisioning Expose provisioning profile inputs in human-readable --list output Sep 23, 2026
@jetm
jetm requested a review from lee-reinhardt September 23, 2026 17:14
@jetm
jetm merged commit d5d7049 into main Sep 24, 2026
11 checks passed
@jetm
jetm deleted the usb-provision-device-flag branch September 24, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants