def _execute_postprocess_policy(env, sectools_install_base_dir, install_file_name, sectools_builder_output, msmid_jtagid_dict, install_policies, sec_image_policy, postprocess=POSTPROCESS_INSTALL): rt_list = [] if len(sectools_builder_output) == 0: #Empty list - the target is excluded return rt_list util = BuilderUtil(env) for install_policy in install_policies: install_directory = install_policy.getDirectory(sec_image_policy.id) if install_directory is None: continue install_directory_processed = signerutils.macro_replace( install_directory, "sectools_install_base_dir", sectools_install_base_dir, isMandatory=False) install_directory_processed = os.path.normpath( util.envsubst(install_directory_processed)) if install_file_name is not None: target_file_path = os.path.join(install_directory_processed, install_file_name) else: path, filename = os.path.split(sectools_builder_output[0]) target_file_path = os.path.join(install_directory_processed, filename) if postprocess == POSTPROCESS_INSTALL: rt = util.installas(target_file_path, sectools_builder_output[0]) elif postprocess == POSTPROCESS_PILSPLIT: pil_split_path, ext = os.path.splitext(target_file_path) rt = util.pilsplit(pil_split_path + ".mdt", sectools_builder_output[0]) else: raise RuntimeError( "{0} not supported in _execute_postprocess_policy".format( postprocess)) rt_list.append(rt) return rt_list
def _execute_install_policy(env, sectools_install_base_dir, install_file_name, sectools_builder_output, alternate_source, msmid_jtagid_dict, install_policies, sec_image_policy_id): rt_list = [] util = BuilderUtil(env) for install_policy in install_policies: install_directory = install_policy.getDirectory(sec_image_policy_id) if install_directory is None: continue install_directory_processed = signerutils.macro_replace( install_directory, "sectools_install_base_dir", sectools_install_base_dir, isMandatory=False) install_directory_processed = os.path.normpath( util.envsubst(install_directory_processed)) if install_file_name is not None: target_file_path = os.path.join(install_directory_processed, install_file_name) else: path, filename = os.path.split(sectools_builder_output[0]) target_file_path = os.path.join(install_directory_processed, filename) if alternate_source is not None: rt = util.installas(target_file_path, alternate_source) else: rt = util.installas(target_file_path, sectools_builder_output[0]) rt_list.append(rt) return rt_list
def _execute_postprocess_policy(env, sectools_install_base_dir, install_file_name, sectools_builder_output, msmid_jtagid_dict, install_policies, sec_image_policy, postprocess=POSTPROCESS_INSTALL): rt_list=[] if len(sectools_builder_output) == 0: #Empty list - the target is excluded return rt_list util = BuilderUtil(env) for install_policy in install_policies: install_directory = install_policy.getDirectory(sec_image_policy.id) if install_directory is None: continue install_directory_processed = signerutils.macro_replace(install_directory, "sectools_install_base_dir", sectools_install_base_dir, isMandatory=False) install_directory_processed = os.path.normpath( util.envsubst(install_directory_processed)) if install_file_name is not None: target_file_path = os.path.join(install_directory_processed, install_file_name) else: path, filename = os.path.split(sectools_builder_output[0]) target_file_path = os.path.join(install_directory_processed, filename) if postprocess == POSTPROCESS_INSTALL: rt = util.installas(target_file_path, sectools_builder_output[0]) elif postprocess == POSTPROCESS_PILSPLIT: pil_split_path, ext = os.path.splitext(target_file_path) rt = util.pilsplit(pil_split_path + ".mdt", sectools_builder_output[0]) else: raise RuntimeError("{0} not supported in _execute_postprocess_policy".format(postprocess)) rt_list.append(rt) return rt_list