@@ -616,7 +616,6 @@ def validateVersAttr(version):
616
616
617
617
618
618
def updateDeviceConfig (file ):
619
- file = paths .CONFIG_INPUT_DIR / file
620
619
# print('*** updateDeviceConfig: ', file)
621
620
# Update the firewall configuration in the OEM DEVICE config file
622
621
# This doesn't do anything except format the json file.
@@ -685,10 +684,9 @@ def main():
685
684
)
686
685
parser .add_argument ("-v" , "--verbose" , help = "verbosity mode" , action = "store_true" )
687
686
parser .add_argument (
688
- "--config-dir " ,
687
+ "--config-file " ,
689
688
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" ,
692
690
)
693
691
parser .add_argument (
694
692
"--output-dir" ,
@@ -708,7 +706,6 @@ def main():
708
706
# Set paths given on command line.
709
707
paths .TOOLKIT_DIR = Path (os .path .dirname (__file__ ))
710
708
paths .CERT_INPUT_DIR = paths .TOOLKIT_DIR / "cert"
711
- paths .CONFIG_INPUT_DIR = Path (args .config_dir )
712
709
paths .FIRMWARE_INPUT_DIR = Path (args .firmware_dir )
713
710
paths .OUTPUT_DIR = Path (args .output_dir )
714
711
@@ -769,12 +766,17 @@ def main():
769
766
sec ["binary" ] = (paths .FIRMWARE_INPUT_DIR / sec ["binary" ]).as_posix ()
770
767
continue
771
768
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 ()
778
780
779
781
# also check unmanaged images (mramAddress != 0) are between boundaries (OEM_BASE_ADDRESS - only in Rev_A as in Rev_B will be 0)
780
782
# and images don't overlap... Also, advice is GAPs (big ones) exist - especially if tool can't create the layout...
0 commit comments