1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-05-07 04:58:57 +00:00

scripts/runfvp: check available terminal types

Improve usability by detecting which terminal types are available on the
system.

Extend the terminal abstraction to support checking whether a terminal
can be executed, and add basic validation for all terminal types. Update
the documentation to reflect the new behavior.

Signed-off-by: Gyorgy Szing <gyorgy.szing@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
Gyorgy Szing
2026-04-23 17:37:19 +02:00
committed by Jon Mason
parent 9d1070b435
commit 2b0fbab119
3 changed files with 96 additions and 12 deletions
+7 -1
View File
@@ -23,7 +23,8 @@ def parse_args(arguments):
parser = argparse.ArgumentParser(description="Run images in a FVP")
parser.add_argument("config", nargs="?", help="Machine name or path to .fvpconf file")
group = parser.add_mutually_exclusive_group()
group.add_argument("-t", "--terminals", choices=terminals.all_terminals(), default=terminals.preferred_terminal(), help="Automatically start terminals (default: %(default)s)")
available_terminals=",".join(terminals.available_terminals())
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.usage = f"{parser.format_usage().strip()} -- [ arguments passed to FVP ]"
@@ -52,6 +53,11 @@ def parse_args(arguments):
def start_fvp(args, fvpconf, extra_args):
fvp = runner.FVPRunner(logger)
try:
if args.terminals:
if not terminal.terminals[args.terminals].is_ready():
return 1
fvp.start(fvpconf, extra_args, args.terminals)
if args.console: