mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 04:01:36 +01:00
Build the Linux kernel independently from Buildroot
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.
This commit is contained in:
8
run-gdb
8
run-gdb
@@ -44,15 +44,17 @@ def main(args, extra_args=None):
|
||||
break_at = []
|
||||
if args.baremetal is None:
|
||||
image = common.vmlinux
|
||||
allowed_toolchains = ['buildroot', 'crosstool-ng', 'host']
|
||||
else:
|
||||
image = common.image
|
||||
allowed_toolchains = ['crosstool-ng', 'buildroot', 'host']
|
||||
cmd = (
|
||||
[common.get_toolchain_tool('gdb')] +
|
||||
[common.get_toolchain_tool('gdb', allowed_toolchains=allowed_toolchains)] +
|
||||
before +
|
||||
['-q']
|
||||
)
|
||||
if args.baremetal is None:
|
||||
cmd.extend(['-ex', 'add-auto-load-safe-path {}'.format(common.linux_variant_dir)])
|
||||
cmd.extend(['-ex', 'add-auto-load-safe-path {}'.format(common.linux_build_dir)])
|
||||
if args.sim:
|
||||
target = 'sim'
|
||||
else:
|
||||
@@ -85,7 +87,7 @@ def main(args, extra_args=None):
|
||||
# which gets put on the kernel build root when python debugging scripts are enabled.
|
||||
cmd.extend(['-ex', 'continue'] + lx_symbols)
|
||||
cmd.extend(after)
|
||||
return common.run_cmd(cmd, cmd_file=os.path.join(common.run_dir, 'run-gdb.sh'), cwd=common.linux_variant_dir)
|
||||
return common.run_cmd(cmd, cmd_file=os.path.join(common.run_dir, 'run-gdb.sh'), cwd=common.linux_build_dir)
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = common.get_argparse(argparse_args={'description': 'Connect with GDB to an emulator to debug Linux itself'})
|
||||
|
||||
Reference in New Issue
Block a user