mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
Tools: added --debug option to build_bootloaders.py
This commit is contained in:
parent
029947efc7
commit
7454822a8b
@ -14,6 +14,7 @@ import fnmatch
|
|||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
parser = ArgumentParser(description='make_secure_bl')
|
parser = ArgumentParser(description='make_secure_bl')
|
||||||
parser.add_argument("--signing-key", type=str, default=None, help="signing key for secure bootloader")
|
parser.add_argument("--signing-key", type=str, default=None, help="signing key for secure bootloader")
|
||||||
|
parser.add_argument("--debug", action='store_true', default=False, help="build with debug symbols")
|
||||||
parser.add_argument("pattern", type=str, default='*', help="board wildcard pattern")
|
parser.add_argument("pattern", type=str, default='*', help="board wildcard pattern")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
@ -50,6 +51,9 @@ def build_board(board):
|
|||||||
if args.signing_key is not None:
|
if args.signing_key is not None:
|
||||||
print("Building secure bootloader")
|
print("Building secure bootloader")
|
||||||
configure_args.append("--signed-fw")
|
configure_args.append("--signed-fw")
|
||||||
|
if args.debug is not None:
|
||||||
|
print("Building with debug symbols")
|
||||||
|
configure_args.append("--debug")
|
||||||
if not run_program(["./waf", "configure"] + configure_args):
|
if not run_program(["./waf", "configure"] + configure_args):
|
||||||
return False
|
return False
|
||||||
if not run_program(["./waf", "clean"]):
|
if not run_program(["./waf", "clean"]):
|
||||||
@ -66,16 +70,24 @@ for board in get_board_list():
|
|||||||
failed_boards.add(board)
|
failed_boards.add(board)
|
||||||
continue
|
continue
|
||||||
bl_file = 'Tools/bootloaders/%s_bl.bin' % board
|
bl_file = 'Tools/bootloaders/%s_bl.bin' % board
|
||||||
|
hex_file = 'Tools/bootloaders/%s_bl.hex' % board
|
||||||
|
elf_file = 'Tools/bootloaders/%s_bl.elf' % board
|
||||||
shutil.copy('build/%s/bin/AP_Bootloader.bin' % board, bl_file)
|
shutil.copy('build/%s/bin/AP_Bootloader.bin' % board, bl_file)
|
||||||
|
print("Created %s" % bl_file)
|
||||||
|
shutil.copy('build/%s/bootloader/AP_Bootloader' % board, elf_file)
|
||||||
|
print("Created %s" % elf_file)
|
||||||
if args.signing_key is not None:
|
if args.signing_key is not None:
|
||||||
print("Signing bootloader with %s" % args.signing_key)
|
print("Signing bootloader with %s" % args.signing_key)
|
||||||
if not run_program(["./Tools/scripts/signing/make_secure_bl.py", bl_file, args.signing_key]):
|
if not run_program(["./Tools/scripts/signing/make_secure_bl.py", bl_file, args.signing_key]):
|
||||||
print("Failed to sign bootloader for %s" % board)
|
print("Failed to sign bootloader for %s" % board)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if not run_program([sys.executable, "Tools/scripts/bin2hex.py", "--offset", "0x08000000", 'Tools/bootloaders/%s_bl.bin' % board, 'Tools/bootloaders/%s_bl.hex' % board]):
|
if not run_program(["./Tools/scripts/signing/make_secure_bl.py", elf_file, args.signing_key]):
|
||||||
|
print("Failed to sign ELF bootloader for %s" % board)
|
||||||
|
sys.exit(1)
|
||||||
|
if not run_program([sys.executable, "Tools/scripts/bin2hex.py", "--offset", "0x08000000", bl_file, hex_file]):
|
||||||
failed_boards.add(board)
|
failed_boards.add(board)
|
||||||
continue
|
continue
|
||||||
shutil.copy('build/%s/bootloader/AP_Bootloader' % board, 'Tools/bootloaders/%s_bl.elf' % board)
|
print("Created %s" % hex_file)
|
||||||
|
|
||||||
if len(failed_boards):
|
if len(failed_boards):
|
||||||
print("Failed boards: %s" % list(failed_boards))
|
print("Failed boards: %s" % list(failed_boards))
|
||||||
|
Loading…
Reference in New Issue
Block a user