Skip to content

Commit b845c37

Browse files
committed
toolkit: Add --config-file to specify app-device-config.json.
And remove --config-dir, it's no longer needed. Signed-off-by: Damien George <[email protected]>
1 parent 4eb172f commit b845c37

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

Diff for: toolkit/app-gen-toc.py

+13-11
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,6 @@ def validateVersAttr(version):
616616

617617

618618
def updateDeviceConfig(file):
619-
file = paths.CONFIG_INPUT_DIR / file
620619
# print('*** updateDeviceConfig: ', file)
621620
# Update the firewall configuration in the OEM DEVICE config file
622621
# This doesn't do anything except format the json file.
@@ -685,10 +684,9 @@ def main():
685684
)
686685
parser.add_argument("-v", "--verbose", help="verbosity mode", action="store_true")
687686
parser.add_argument(
688-
"--config-dir",
687+
"--config-file",
689688
type=str,
690-
default=Path(os.path.dirname(__file__)) / "build/config",
691-
help="directory with configuration files",
689+
help="application device configuration file to use",
692690
)
693691
parser.add_argument(
694692
"--output-dir",
@@ -708,7 +706,6 @@ def main():
708706
# Set paths given on command line.
709707
paths.TOOLKIT_DIR = Path(os.path.dirname(__file__))
710708
paths.CERT_INPUT_DIR = paths.TOOLKIT_DIR / "cert"
711-
paths.CONFIG_INPUT_DIR = Path(args.config_dir)
712709
paths.FIRMWARE_INPUT_DIR = Path(args.firmware_dir)
713710
paths.OUTPUT_DIR = Path(args.output_dir)
714711

@@ -769,12 +766,17 @@ def main():
769766
sec["binary"] = (paths.FIRMWARE_INPUT_DIR / sec["binary"]).as_posix()
770767
continue
771768

772-
print("Generating Device Configuration for: " + sec["binary"])
773-
updateDeviceConfig(sec["binary"])
774-
gen_device_config(sec["binary"], False)
775-
sec["binary"] = (
776-
(paths.OUTPUT_DIR / sec["binary"]).with_suffix(".bin").as_posix()
777-
)
769+
# get app-device-config.json filename: either specified on command-line, or from config
770+
if args.config_file is not None:
771+
input_device_config = args.config_file
772+
else:
773+
input_device_config = paths.TOOLKIT_DIR / "build/config" / sec["binary"]
774+
binary = os.path.basename(input_device_config)
775+
776+
print("Generating Device Configuration for: " + binary)
777+
updateDeviceConfig(input_device_config)
778+
gen_device_config(input_device_config, False)
779+
sec["binary"] = (paths.OUTPUT_DIR / binary).with_suffix(".bin").as_posix()
778780

779781
# also check unmanaged images (mramAddress != 0) are between boundaries (OEM_BASE_ADDRESS - only in Rev_A as in Rev_B will be 0)
780782
# and images don't overlap... Also, advice is GAPs (big ones) exist - especially if tool can't create the layout...

Diff for: toolkit/utils/device_config.py

-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ def processMiscellaneous(configuration):
239239

240240

241241
def gen_device_config(file, is_icv):
242-
file = paths.CONFIG_INPUT_DIR / file
243242
cfg = read_global_config(file)
244243
validateSections(cfg, file) # request from SE-1938
245244
f = createBinary((paths.OUTPUT_DIR / os.path.basename(file)).with_suffix(".bin"))

Diff for: toolkit/utils/paths.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22

33
TOOLKIT_DIR = ""
44
CERT_INPUT_DIR = ""
5-
CONFIG_INPUT_DIR = ""
65
FIRMWARE_INPUT_DIR = ""
76
OUTPUT_DIR = ""

0 commit comments

Comments
 (0)