From 8159819087744de2edea99f1b786ec528021db82 Mon Sep 17 00:00:00 2001 From: Koen Zandberg Date: Mon, 28 Sep 2020 22:52:14 +0200 Subject: [PATCH] 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. --- dist/tools/suit/gen_manifest.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dist/tools/suit/gen_manifest.py b/dist/tools/suit/gen_manifest.py index cbd88c4285..0b0f28582e 100755 --- a/dist/tools/suit/gen_manifest.py +++ b/dist/tools/suit/gen_manifest.py @@ -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: