mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 19:21:35 +01:00
Please python stop torturing me with refactors. Make ./run -u blow up if executable not found, otherwise I go crazy. Get ./test-gdb back to life after the ./run relative path refactor, forgot to test this.
35 lines
857 B
Python
Executable File
35 lines
857 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import os
|
|
import shutil
|
|
import sys
|
|
|
|
import common
|
|
|
|
build_linux = common.import_path_relative_root('build-linux')
|
|
run = common.import_path_relative_root('run')
|
|
|
|
parser = self.get_argparse(
|
|
argparse_args={
|
|
'description': '''Bisect the Linux kernel on gem5 boots.
|
|
|
|
More information at: https://github.com/cirosantilli/linux-kernel-module-cheat#bisection
|
|
'''},
|
|
default_args={
|
|
'emulators': ['gem5'],
|
|
'linux_build_id': 'bisect',
|
|
},
|
|
)
|
|
args = self.setup(parser)
|
|
# We need a clean rebuild because rebuilds at different revisions:
|
|
# - may fail
|
|
# - may not actually rebuild all files, e.g. on header changes
|
|
self.rmrf(kwargs['linux_build_dir'])
|
|
build_linux.LinuxComponent().do_build(args)
|
|
status = run.main(args, {
|
|
'eval': 'm5 exit',
|
|
})
|
|
if status == 125 or status == 127:
|
|
status = 1
|
|
sys.exit(status)
|