mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-04-20 11:29:54 +00:00
runfvp: pass arbitrary options after -- to the FVP binary
To allow passing arbitrary options to the FVP binary, split the passed options on --. Anything before the separator is handled by runfvp, anything afterwards is passed as-is to the FVP binary. Change-Id: I686b2fb79d217e26988753be7bd067c638d69eac Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
@@ -46,9 +46,18 @@ def runfvp(args):
|
||||
group.add_argument("-c", "--console", action="store_true", help="Attach the first uart to stdin/stdout")
|
||||
parser.add_argument("-C", "--parameter", action="append", default=[], help="Extra configuration parameters for FVP")
|
||||
parser.add_argument("--verbose", action="store_true", help="Output verbose logging")
|
||||
parser.usage = f"{parser.format_usage().strip()} -- [ arguments passed to FVP ]"
|
||||
# TODO option for telnet vs netcat
|
||||
|
||||
args = parser.parse_args()
|
||||
try:
|
||||
i = sys.argv.index("--")
|
||||
arguments = sys.argv[1:i]
|
||||
fvp_args = sys.argv[i+1:]
|
||||
except ValueError:
|
||||
arguments = sys.argv[1:]
|
||||
fvp_args = []
|
||||
|
||||
args = parser.parse_args(args=arguments)
|
||||
logging.basicConfig(level=args.verbose and logging.DEBUG or logging.WARNING)
|
||||
logger.debug(f"Parsed arguments are {vars(args)}")
|
||||
|
||||
@@ -120,10 +129,13 @@ def runfvp(args):
|
||||
|
||||
cli.extend(config["args"])
|
||||
|
||||
# Finally add the user's extra arguments
|
||||
# Add any explicit --parameter calls
|
||||
for param in args.parameter:
|
||||
cli.extend(["--parameter", param])
|
||||
|
||||
# Finally add the user's extra arguments
|
||||
cli.extend(fvp_args)
|
||||
|
||||
logger.debug(f"Constructed FVP call: {cli}")
|
||||
if args.console:
|
||||
expected_terminal = config["console"]
|
||||
|
||||
Reference in New Issue
Block a user