1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tools/suit: Add optional component ID argument

This extends the component argument of the gen_manifest.py script with
an optional component name. As component names in the SUIT manifest
consist of an array of bytestrings, the commponent name in the argument
is also split. Each part of the name ends up as a separate part of the
component name in the manifest. Component names are split by colons to
match the separator used in the rest of the argument.
This commit is contained in:
Koen Zandberg 2020-09-28 22:52:14 +02:00
parent f05c5f7708
commit 8159819087
No known key found for this signature in database
GPG Key ID: 0895A893E6D2985B

View File

@ -51,28 +51,31 @@ def main(args):
images = []
for filename_offset in args.slotfiles:
split = filename_offset.split(":")
comp_name = ["00"]
split = filename_offset.split(":", maxsplit=2)
if len(split) == 1:
filename, offset = split[0], 0
else:
elif len(split) == 2:
filename, offset = split[0], str2int(split[1])
else:
filename, offset, comp_name = split[0], str2int(split[1]), split[2].split(":")
images.append((filename, offset))
images.append((filename, offset, comp_name))
template["components"] = []
for slot, image in enumerate(images):
filename, offset = image
filename, offset, comp_name = image
uri = os.path.join(args.urlroot, os.path.basename(filename))
component = {
"install-id": ["00"],
"install-id": comp_name,
"vendor-id": uuid_vendor.hex,
"class-id": uuid_class.hex,
"file": filename,
"uri": uri,
"bootable": True,
"bootable": False,
}
if offset: