diff mbox series

runfvp: add --dry-run option

Message ID 20260528082357.893275-1-michael.safwat@arm.com
State New
Headers show
Series runfvp: add --dry-run option | expand

Commit Message

Michael Safwat May 28, 2026, 8:23 a.m. UTC
Add a --dry-run option to scripts/runfvp to print the constructed
FVP command line and exit without launching the model.

This is useful for checking parameters and reusing them with different
FVP binaries.

Signed-off-by: Michael Safwat <michael.safwat@arm.com>
---
 scripts/runfvp | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/scripts/runfvp b/scripts/runfvp
index 10a8ad1c..5a1d3d73 100755
--- a/scripts/runfvp
+++ b/scripts/runfvp
@@ -27,6 +27,7 @@  def parse_args(arguments):
     group.add_argument("-t", "--terminals", choices=terminals.all_terminals(), default=terminals.preferred_terminal(), help=f"Automatically start terminals (default: %(default)s). Available terminals are ({available_terminals})")
     group.add_argument("-c", "--console", action="store_true", help="Attach the first uart to stdin/stdout")
     parser.add_argument("--verbose", action="store_true", help="Output verbose logging")
+    parser.add_argument("--dry-run", action="store_true", help="Print the FVP command and exit")
     parser.usage = f"{parser.format_usage().strip()} -- [ arguments passed to FVP ]"
     # TODO option for telnet vs netcat
 
@@ -54,6 +55,12 @@  def start_fvp(args, fvpconf, extra_args):
     fvp = runner.FVPRunner(logger)
     try:
 
+        if args.dry_run:
+            config = conffile.load(fvpconf)
+            cli = runner.cli_from_config(config, args.terminals) + extra_args
+            print(runner.shlex_join(cli))
+            return 0
+
         if args.terminals:
             if not terminal.terminals[args.terminals].is_ready():
                 return 1