Lines Matching defs:image

146 	    "failed to allocate memory for image descriptor");
149 "failed to allocate memory for image name");
151 "failed to allocate memory for image command line name");
175 if (desc->image) {
176 free(desc->image->buffer);
177 free(desc->image);
342 image_t *image;
352 * Build a new image out of the ToC entry and add it to the
355 image = xzalloc(sizeof(*image),
356 "failed to allocate memory for image");
357 image->toc_e = *toc_entry;
358 image->buffer = xmalloc(toc_entry->size,
359 "failed to allocate image buffer, is FIP file corrupted?");
368 memcpy(image->buffer, buf + toc_entry->offset_address,
371 /* If this is an unknown image, create a descriptor for it. */
386 assert(desc->image == NULL);
387 desc->image = image;
402 image_t *image;
415 image = xzalloc(sizeof(*image), "failed to allocate memory for image");
416 image->toc_e.uuid = *uuid;
417 image->buffer = xmalloc(st.st_size, "failed to allocate image buffer");
418 if (fread(image->buffer, 1, st.st_size, fp) != st.st_size)
420 image->toc_e.size = st.st_size;
423 return image;
426 static int write_image_to_file(const image_t *image, const char *filename)
433 xfwrite(image->buffer, image->toc_e.size, fp, filename);
494 image_t *image = desc->image;
496 if (image == NULL)
500 (unsigned long long)image->toc_e.offset_address,
501 (unsigned long long)image->toc_e.size,
513 SHA256(image->buffer, image->toc_e.size, md);
541 if (desc->image != NULL)
550 /* Build up header and ToC entries from the image table. */
560 image_t *image = desc->image;
562 if (image == NULL || (image->toc_e.size == 0ULL))
564 payload_size += image->toc_e.size;
566 image->toc_e.offset_address = entry_offset;
567 *toc_entry++ = image->toc_e;
568 entry_offset += image->toc_e.size;
593 image_t *image = desc->image;
595 if (image == NULL)
597 if (fseek(fp, image->toc_e.offset_address, SEEK_SET))
600 xfwrite(image->buffer, image->toc_e.size, fp, filename);
620 * internal image table is not populated.
628 image_t *image;
633 image = read_image_from_file(&desc->uuid,
635 if (desc->image != NULL) {
641 free(desc->image);
642 desc->image = image;
645 log_dbgx("Adding image %s",
647 desc->image = image;
782 printf(" --align <value>\t\tEach image is aligned to <value> (default: 1).\n");
783 printf(" --blob uuid=...,file=...\tAdd an image with the given UUID pointed to by file.\n");
901 printf(" --align <value>\t\tEach image is aligned to <value> (default: 1).\n");
902 printf(" --blob uuid=...,file=...\tAdd or update an image with the given UUID pointed to by file.\n");
1002 image_t *image = desc->image;
1015 if (image == NULL) {
1025 write_image_to_file(image, file);
1042 printf(" --blob uuid=...,file=...\tUnpack an image with the given UUID to file.\n");
1149 if (desc->image != NULL) {
1153 free(desc->image);
1154 desc->image = NULL;
1172 printf(" --align <value>\tEach image is aligned to <value> (default: 1).\n");
1173 printf(" --blob uuid=...\tRemove an image with the given UUID.\n");