[PATCH] runfvp: add --dry-run option

Michael Safwat <[email protected]> Thu, 28 May 2026 09:23:57 +0100
Newsgroups org.yoctoproject.lists.meta-arm
Message-ID <[email protected]>
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 <[email protected]>
---
 scripts/runfvp | 7 +++++++
 1 file changed, 7 insertions(+)

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=3Dterminals.all_term=
inals(), default=3Dterminals.preferred_terminal(), help=3Df"Automatically=
 start terminals (default: %(default)s). Available terminals are ({availa=
ble_terminals})")
     group.add_argument("-c", "--console", action=3D"store_true", help=3D=
"Attach the first uart to stdin/stdout")
     parser.add_argument("--verbose", action=3D"store_true", help=3D"Outp=
ut verbose logging")
+    parser.add_argument("--dry-run", action=3D"store_true", help=3D"Prin=
t the FVP command and exit")
     parser.usage =3D f"{parser.format_usage().strip()} -- [ arguments pa=
ssed to FVP ]"
     # TODO option for telnet vs netcat
=20
@@ -54,6 +55,12 @@ def start_fvp(args, fvpconf, extra_args):
     fvp =3D runner.FVPRunner(logger)
     try:
=20
+        if args.dry_run:
+            config =3D conffile.load(fvpconf)
+            cli =3D runner.cli_from_config(config, args.terminals) + ext=
ra_args
+            print(runner.shlex_join(cli))
+            return 0
+
         if args.terminals:
             if not terminal.terminals[args.terminals].is_ready():
                 return 1