For others using platformIO, I found this to be a reasonable approach to replacing the file:
1) Add a pre-build script to your env
Code:
[env:teensy_flight_computer]
platform = teensy
board = teensy40
extra_scripts = pre:apply_patches.py
2) Add a python script that can find and make the appropriate change:
Code:
from os.path import join
Import("env")
FRAMEWORK_DIR = join(env.PioPlatform().get_package_dir("framework-arduinoteensy"),"cores","teensy4","startup.c")
print(FRAMEWORK_DIR)
search = "if (++count >= 80) break; // reboot after 8 seconds"
replace = "break; // MODIFIED - reboot immediately"
with open(FRAMEWORK_DIR, 'r') as file:
data = file.read()
if data.find(search):
data = data.replace(search, replace)
else:
exit()
with open(FRAMEWORK_DIR, 'w') as file:
file.write(data)
# Printing Text replaced
print(f"Updated startup.c line {search} to {replace}")