futility/updater_archive.c
/*
 * Changes the VBlock in firmware section to new data.
 * Returns 0 on success, otherwise failure.
 */
Changes the VBlock in firmware section to new data.
Returns 0 on success, otherwise failure.
Changes the VBlock in firmware section to new data . Returns 0 on success otherwise failure .
static int change_vblock(struct firmware_image *image, const char *section_name,
			 const uint8_t *vblock, uint32_t vblock_len)
{
	struct firmware_section section;
	find_firmware_section(&section, image, section_name);
	if (!section.data) {
		ERROR("Need section %s in image %s.\n", section_name,
		      image->file_name);
		return -1;
	}
	if (section.size < vblock_len) {
		ERROR("Section %s too small (%zu bytes) for vblock (%u bytes).\n",
		      section_name, section.size, vblock_len);
		return -1;
	}
	memcpy(section.data, vblock, vblock_len);
	return 0;
}
static int change_vblock ( struct firmware_image * image , const char * section_name , const uint8_t * vblock , uint32_t vblock_len ) { struct firmware_section section ; find_firmware_section ( & section , image , section_name ) ; if ( ! section . data ) { ERROR ( " \n " , section_name , image -> file_name ) ; return -1 ; } if ( section . size < vblock_len ) { ERROR ( " \n " , section_name , section . size , vblock_len ) ; return -1 ; } memcpy ( section . data , vblock , vblock_len ) ; return 0 ; }
Changes the VBlock in firmware section to new data.
Changes the VBlock in firmware section to new data .