T-DeckLoader/custom_bootloader.py

13 lines
382 B
Python
Raw Normal View History

2024-06-09 05:14:09 +00:00
import os
import shutil
Import("env")
def copy_bootloader(source, target, env):
custom_bootloader = os.path.join("blob", "tdboot_bootloader.bin")
target_bootloader = os.path.join(env.subst("$BUILD_DIR"), "bootloader.bin")
shutil.copyfile(custom_bootloader, target_bootloader)
print("Bootloader replaced successfully.")
env.AddPreAction("upload", copy_bootloader)