mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-13 20:12:26 +00:00
This will allow for other types of root filesystems that don't rely on Buildroot to be added and used in the future. Propagate --verbose on all build scripts to see full GCC commands. build-all: allow for neat subsets also 9p share rootfs_overlay. TODO document.
51 lines
1.1 KiB
Python
Executable File
51 lines
1.1 KiB
Python
Executable File
#!/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.baremetal is None:
|
|
image = common.vmlinux
|
|
else:
|
|
image = common.image
|
|
tool= common.get_toolchain_tool(args.tool, allowed_toolchains=allowed_toolchains)
|
|
if args.dry:
|
|
print(tool)
|
|
else:
|
|
sys.exit(common.run_cmd(
|
|
[tool] + args.extra_args,
|
|
cmd_file=os.path.join(common.run_dir, 'run-toolchain.sh'),
|
|
))
|