platform = pfm_platform_id(header, platform_id, alignment_buf)
    platform.header.length = ctypes.sizeof(pfm_platform_id)

    return platform

#*************************************** Start of Script ***************************************

default_config = os.path.join(os.path.dirname(os.path.abspath(__file__)), PFM_CONFIG_FILENAME)
parser = argparse.ArgumentParser(description = 'Create a PFM')
parser.add_argument('config', nargs = '?', default = default_config,
    help = 'Path to configurtaion file')
parser.add_argument('--bypass', action = 'store_true', help = 'Create a bypass mode PFM')
args = parser.parse_args()

processed_xml, sign, key_size, key, pfm_id, output = manifest_common.load_xmls (args.config, None,
    manifest_types.PFM)

process_pbkey(processed_xml)

if (args.bypass):
    allowable_fw_list = []
else:
    allowable_fw_list = generate_allowable_fw_list(processed_xml)
allowable_fw_header = generate_allowable_fw_header(allowable_fw_list)

if (args.bypass):
    keys_list = []
else:
    keys_list = generate_pbkey_list()
keys_header = generate_pbkey_header(keys_list)
    for component in components_list:
        size = size + ctypes.sizeof(component)

    return cfm_components_header(size, len(components_list), 0)


#*************************************** Start of Script ***************************************

if len(sys.argv) < 2:
    path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                        CFM_CONFIG_FILENAME)
else:
    path = os.path.abspath(sys.argv[1])

processed_xml, sign, key_size, key, id, output = manifest_common.load_xmls(
    path, None, manifest_types.CFM)

components_list = generate_components_list(processed_xml)
components_header = generate_components_header(components_list)
cfm_header_instance = manifest_common.generate_manifest_header(
    id, key_size, manifest_types.CFM)
cfm_header_instance.length = ctypes.sizeof(cfm_header_instance) + components_header.length + \
    cfm_header_instance.sig_length

cfm = generate_cfm(cfm_header_instance, components_header, components_list)

manifest_common.write_manifest(
    sign, cfm, key, output,
    cfm_header_instance.length - cfm_header_instance.sig_length,
    cfm_header_instance.sig_length)
Пример #3
0
                              PFM_CONFIG_FILENAME)
parser = argparse.ArgumentParser(description='Create a PFM')
parser.add_argument('config',
                    nargs='?',
                    default=default_config,
                    help='Path to configuration file')
parser.add_argument('--bypass',
                    action='store_true',
                    help='Create a bypass mode PFM')
args = parser.parse_args()
platform_header = None
allowable_fw_list = None
pfm = None

processed_xml, sign, key_size, key, key_type, hash_type, pfm_id, output, xml_version, empty = \
    manifest_common.load_xmls (args.config, None, manifest_types.PFM)

pfm_header_instance = manifest_common.generate_manifest_header(
    pfm_id, key_size, manifest_types.PFM, hash_type, key_type, xml_version)

platform_id = manifest_common.get_platform_id(processed_xml)

if xml_version == manifest_types.VERSION_2:
    flash_device = None
    if (args.bypass):
        allowable_fw_list = {}
        fw_types = {}
        fw_flags = {}
    else:
        allowable_fw_list, fw_types, fw_flags, unused_byte = generate_allowable_fw_list_v2(
            processed_xml, xml_version)
Пример #4
0
    return components_buf, len(xml_components), components_toc_list, hash_list


#*************************************** Start of Script ***************************************

default_config = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                              PCD_CONFIG_FILENAME)
parser = argparse.ArgumentParser(description='Create a PCD')
parser.add_argument('config',
                    nargs='?',
                    default=default_config,
                    help='Path to configuration file')
args = parser.parse_args()

processed_xml, sign, key_size, key, key_type, hash_type, pcd_id, output, xml_version, empty = \
    manifest_common.load_xmls (args.config, 1, manifest_types.PCD)

hash_engine = manifest_common.get_hash_engine(hash_type)

processed_xml = list(processed_xml.items())[0][1]

num_components = 0
num_ports = 0
pcd_len = 0
elements_list = []
toc_list = []
hash_list = []

manifest_header = manifest_common.generate_manifest_header(
    pcd_id, key_size, manifest_types.PCD, hash_type, key_type, xml_version)
manifest_header_len = ctypes.sizeof(manifest_header)