Skip to content

Conversation

@5frank
Copy link

@5frank 5frank commented Feb 4, 2026

Add option -F, --format [yaml|json|human] to imgtool dumpinfo command.

Backward compatible:

  • imgtool dumpinfo input.bin --> human-friendly format to stdout (default)
  • imgtool dumpinfo --outfile=output.txt input.bin --> YAML format to file (existing behavior)
  • imgtool dumpinfo --format=json input.bin --> JSON format to stdout
  • imgtool dumpinfo --format=yaml input.bin --> YAML format to stdout

JSON output has both "type" and "type_name", example:
"tlvs": [ { "type": 16, "type_name": "SHA256", ... } ]

Add option `-F, --format [yaml|json|human]` to `imgtool dumpinfo` command.

Backward compatible:
  - `imgtool dumpinfo input.bin` --> human-friendly format to stdout (default)
  - `imgtool dumpinfo --outfile=output.txt input.bin` --> YAML format to file (existing behavior)
  - `imgtool dumpinfo --format=json input.bin` --> JSON format to stdout
  - `imgtool dumpinfo --format=yaml input.bin` --> YAML format to stdout

JSON output has both "type" and "type_name, example:

    "tlvs": [ { "type": 16, "type_name": "SHA256", ... } ]
@5frank 5frank requested a review from d3zd3z as a code owner February 4, 2026 17:16
@nordicjm
Copy link
Collaborator

nordicjm commented Feb 5, 2026

@fundakol please review

@nordicjm
Copy link
Collaborator

nordicjm commented Feb 5, 2026

@5frank please see failing CI

@fundakol
Copy link
Collaborator

fundakol commented Feb 5, 2026

Usage of dumpinfo is now very confusing.

  • this command does nothing: imgtool dumpinfo zephyr.signed.bin --format human -o dump.txt --silent
  • this command: imgtool dumpinfo zephyr.signed.bin --format human -o dump.txt works same as imgtool dumpinfo zephyr.signed.bin and imgtool dumpinfo zephyr.signed.bin --format yaml
  • when human format is selected option outfile has no effect

imgtool dumpinfo zephyr.signed.bin --format yaml -o dump.yaml --> produced different yaml then it was before your change, so it is not backward compatible.

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.

3 participants