🏗️ Refactor build encrypt / rename (#22124)

This commit is contained in:
Scott Lahteine
2021-06-13 15:43:33 -05:00
committed by Scott Lahteine
parent 14ffc66c45
commit 2aa35577f2
8 changed files with 59 additions and 63 deletions

View File

@@ -3,6 +3,7 @@
#
# Apply encryption and save as 'build.firmware' for these environments:
# - env:mks_robin
# - env:mks_robin_e3
# - env:flsun_hispeedv1
# - env:mks_robin_nano35
#
@@ -11,18 +12,18 @@ Import("env")
from SCons.Script import DefaultEnvironment
board = DefaultEnvironment().BoardConfig()
if 'firmware' in board.get("build").keys():
if 'encrypt' in board.get("build").keys():
import marlin
# Encrypt ${PROGNAME}.bin and save it as build.firmware
# Encrypt ${PROGNAME}.bin and save it with the name given in build.encrypt
def encrypt(source, target, env):
marlin.encrypt_mks(source, target, env, board.get("build.firmware"))
marlin.encrypt_mks(source, target, env, board.get("build.encrypt"))
marlin.add_post_action(encrypt);
else:
import sys
print("You need to define output file via board_build.firmware = 'filename' parameter", file=sys.stderr)
print("You need to define output file via board_build.encrypt = 'filename' parameter", file=sys.stderr)
env.Exit(1);