#!/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('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) sys.exit(subprocess.Popen([common.get_toolchain_tool(args.tool)] + args.extra_args).wait())