Skip to content

toolkit: Allow an absolute path for app-device-config.json. #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions toolkit/app-gen-toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,6 @@ def validateVersAttr(version):


def updateDeviceConfig(file):
file = paths.CONFIG_INPUT_DIR / file
# print('*** updateDeviceConfig: ', file)
# Update the firewall configuration in the OEM DEVICE config file
# This doesn't do anything except format the json file.
Expand Down Expand Up @@ -685,10 +684,9 @@ def main():
)
parser.add_argument("-v", "--verbose", help="verbosity mode", action="store_true")
parser.add_argument(
"--config-dir",
"--cfg-binary",
type=str,
default=Path(os.path.dirname(__file__)) / "build/config",
help="directory with configuration files",
help="application device configuration file to use (overrides json 'binary' value)",
)
parser.add_argument(
"--output-dir",
Expand All @@ -708,7 +706,6 @@ def main():
# Set paths given on command line.
paths.TOOLKIT_DIR = Path(os.path.dirname(__file__))
paths.CERT_INPUT_DIR = paths.TOOLKIT_DIR / "cert"
paths.CONFIG_INPUT_DIR = Path(args.config_dir)
paths.FIRMWARE_INPUT_DIR = Path(args.firmware_dir)
paths.OUTPUT_DIR = Path(args.output_dir)

Expand Down Expand Up @@ -769,12 +766,22 @@ def main():
sec["binary"] = (paths.FIRMWARE_INPUT_DIR / sec["binary"]).as_posix()
continue

print("Generating Device Configuration for: " + sec["binary"])
updateDeviceConfig(sec["binary"])
gen_device_config(sec["binary"], False)
sec["binary"] = (
(paths.OUTPUT_DIR / sec["binary"]).with_suffix(".bin").as_posix()
)
# get app-device-config.json filename: either specified on command-line, or from config
if args.cfg_binary is not None:
input_device_config = args.cfg_binary
else:
input_device_config = sec["binary"]
if not os.path.isabs(input_device_config):
input_device_config = (
paths.TOOLKIT_DIR / "build/config" / input_device_config
)

binary = os.path.basename(input_device_config)

print("Generating Device Configuration for: " + binary)
updateDeviceConfig(input_device_config)
gen_device_config(input_device_config, False)
sec["binary"] = (paths.OUTPUT_DIR / binary).with_suffix(".bin").as_posix()

# also check unmanaged images (mramAddress != 0) are between boundaries (OEM_BASE_ADDRESS - only in Rev_A as in Rev_B will be 0)
# and images don't overlap... Also, advice is GAPs (big ones) exist - especially if tool can't create the layout...
Expand Down
1 change: 0 additions & 1 deletion toolkit/utils/device_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ def processMiscellaneous(configuration):


def gen_device_config(file, is_icv):
file = paths.CONFIG_INPUT_DIR / file
cfg = read_global_config(file)
validateSections(cfg, file) # request from SE-1938
f = createBinary((paths.OUTPUT_DIR / os.path.basename(file)).with_suffix(".bin"))
Expand Down
1 change: 0 additions & 1 deletion toolkit/utils/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@

TOOLKIT_DIR = ""
CERT_INPUT_DIR = ""
CONFIG_INPUT_DIR = ""
FIRMWARE_INPUT_DIR = ""
OUTPUT_DIR = ""