runtc: rename to run-toochain

Names up to two full words are saner and not too long
This commit is contained in:
Ciro Santilli
2018-09-14 11:33:22 +01:00
parent 952b6dbb76
commit 98e32a5496
2 changed files with 15 additions and 15 deletions

47
run-toolchain Executable file
View File

@@ -0,0 +1,47 @@
#!/usr/bin/env python3
import os
import subprocess
import sys
import common
parser = common.get_argparse(argparse_args={
'description': '''Run a Buildroot ToolChain tool like readelf or objdump.
For example, to get some information about the arm vmlinux:
....
./%(prog)s readelf -- -e "$(./getvar vmlinux)"
....
Get the list of available tools with:
....
ls "$(./getvar -a arm host_bin_dir)"
....
'''
})
parser.add_argument(
'--dry',
help='Just output the tool path to stdout but actually run it',
action='store_true',
)
parser.add_argument('tool', help='Which tool to run.')
parser.add_argument(
'extra_args',
default=[],
help='Extra arguments for the tool.',
metavar='extra-args',
nargs='*'
)
args = common.setup(parser)
if args.dry:
print(common.get_toolchain_tool(args.tool))
else:
sys.exit(common.run_cmd(
[common.get_toolchain_tool(args.tool)] + args.extra_args,
cmd_file=os.path.join(common.run_dir, 'run-toolchain.sh'),
cwd=common.linux_variant_dir,
show_cmd=False,
))