From 87909b51877a7876030d249d1afe18fba9ec177a Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 26 Jun 2024 09:39:51 +1000 Subject: [PATCH] Tools: create_OEM_board.py: include defaults.parm, don't copy it --- Tools/scripts/create_OEM_board.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Tools/scripts/create_OEM_board.py b/Tools/scripts/create_OEM_board.py index 0ad6eeac4205e..f07b3d359e139 100755 --- a/Tools/scripts/create_OEM_board.py +++ b/Tools/scripts/create_OEM_board.py @@ -11,6 +11,8 @@ import os import subprocess +import pathlib + board_name = sys.argv[1] oem_board_name = sys.argv[2] @@ -26,8 +28,5 @@ f.write("include ../%s/hwdef-bl.dat" % board_name) f.close() if os.path.exists("libraries/AP_HAL_ChibiOS/hwdef/%s/defaults.parm" % board_name): - subprocess.run([ - "cp", - "libraries/AP_HAL_ChibiOS/hwdef/%s/defaults.parm" % board_name, - "libraries/AP_HAL_ChibiOS/hwdef/%s/defaults.parm" % oem_board_name, - ]) + path = pathlib.Path(f"libraries/AP_HAL_ChibiOS/hwdef/{oem_board_name}/defaults.parm") + path.write_text(f"@include ../{board_name}/defaults.parm\n") # noqa