Example #1
0
    def _generate_config_file(self):
        if self.input.sign_id.lower().endswith("ewm"):
            logger.debug(
                "Generating new config files with provided values for relocatable and image_entry..."
            )
            new_config_file = c_path.join(self.input.target_base_dir,
                                          "generated_config.xml")
            config = ConfigParser(self.input.config)

            image_type_list = config.root.parsegen.get_image_types_list()
            for image_type in image_type_list.get_image_type():
                if image_type.id == EWM_TYPE:
                    if self.input.relocatable is not None:
                        # Override relocatable setting
                        image_type.ewm_properties.relocatable = self.input.relocatable
                        logger.debug(
                            "Overrode config's relocatable value with {0}".
                            format(self.input.relocatable))
                    if self.input.image_entry is not None:
                        # Override image_entry
                        image_type.ewm_properties.image_entry = self.input.image_entry
                        logger.debug(
                            "Overrode config's image_entry value with {0}".
                            format(self.input.image_entry))

            config.generate(new_config_file)
            self.input.config = new_config_file
            logger.debug(
                "New config file generated at \"{0}\"".format(new_config_file))
    def _generate_config_file(self, src_config, dest_config, image_entry,
                              relocatable):
        config = ConfigParser(src_config)

        image_type_list = config.root.parsegen.get_image_types_list()
        for image_type in image_type_list.get_image_type():
            if image_type.id == EWM_TYPE:
                #Override relocatable setting
                image_type.ewm_properties.relocatable = relocatable
                if image_entry is not None:
                    #Override image_entry
                    image_type.ewm_properties.image_entry = image_entry

        config.generate(dest_config)
    def _generate_config_file(self, src_config, dest_config,
                              image_entry, relocatable):
        config = ConfigParser(src_config)

        image_type_list = config.root.parsegen.get_image_types_list()
        for image_type in image_type_list.get_image_type():
            if image_type.id == "elf_wrapped_mbn":
                #Override relocatable setting
                image_type.ewm_properties.relocatable = relocatable
                if image_entry is not None:
                    #Override image_entry
                    image_type.ewm_properties.image_entry = image_entry

        config.generate(dest_config)
Example #4
0
    def generate_config_file(self, src_config, dest_config, args):
        config = ConfigParser(src_config)

        if args.cass is True:
            config.root.general_properties.selected_signer = 'cass'

            if args.capability:
                config.root.general_properties.cass_capability = args.capability

            #Enable test interface
            server_config = self._get_server()
            if server_config is not None:
                config.root.signing.signer_attributes.\
                    cass_signer_attributes.server = server_config
            user_identity = self._get_user_identity()
            if user_identity is not None:
                config.root.signing.signer_attributes.\
                    cass_signer_attributes.user_identity = user_identity

        sign_id = self._get_sign_id()

        image_list = config._get_image_list()
        for image in image_list:
            if image.sign_id == sign_id:
                break
        else:
            raise RuntimeError('sign_id: ' + sign_id +
                               ' not found in config file')

        image.general_properties_overrides.testsig_serialnum = self.serialnum.str if self.serialnum is not None else None
        if args.tcg_min:
            image.general_properties_overrides.object_id.min = args.tcg_min
        if args.tcg_max:
            image.general_properties_overrides.object_id.max = args.tcg_max
        if args.tcg_fix:
            image.general_properties_overrides.object_id.min = args.tcg_fix
            image.general_properties_overrides.object_id.max = args.tcg_fix

        config.generate(dest_config)