Exemplo n.º 1
0
/*
 * This function is shared between the create and update subcommands.
 * The difference between the two subcommands is that when the FIP file
 * is created, the parsing of an existing FIP is skipped.  This results
 * in update_fip() creating the new FIP file from scratch because the
 * internal image table is not populated.
 */
static void update_fip(void)
{
    toc_entry_t *toc_entry;
    image_t *new_image, *old_image;

    /* Add or replace images in the FIP file. */
    for (toc_entry = toc_entries;
            toc_entry->cmdline_name != NULL;
            toc_entry++) {
        if (toc_entry->action != DO_PACK)
            continue;

        new_image = read_image_from_file(&toc_entry->uuid,
                                         toc_entry->action_arg);
        old_image = lookup_image_from_uuid(&toc_entry->uuid);
        if (old_image != NULL) {
            if (verbose)
                log_dbgx("Replacing image %s.bin with %s",
                         toc_entry->cmdline_name,
                         toc_entry->action_arg);
            replace_image(old_image, new_image);
        } else {
            if (verbose)
                log_dbgx("Adding image %s",
                         toc_entry->action_arg);
            add_image(new_image);
        }

        free(toc_entry->action_arg);
        toc_entry->action_arg = NULL;
    }
}
Exemplo n.º 2
0
/*
 * This function is shared between the create and update subcommands.
 * The difference between the two subcommands is that when the FIP file
 * is created, the parsing of an existing FIP is skipped.  This results
 * in update_fip() creating the new FIP file from scratch because the
 * internal image table is not populated.
 */
static void update_fip(void)
{
    toc_entry_t *toc_entry;
    image_t *image;

    /* Add or replace images in the FIP file. */
    for (toc_entry = toc_entries;
            toc_entry->cmdline_name != NULL;
            toc_entry++) {
        if (toc_entry->action != DO_PACK)
            continue;

        image = read_image_from_file(toc_entry, toc_entry->action_arg);
        if (toc_entry->image != NULL) {
            if (verbose)
                log_dbgx("Replacing image %s.bin with %s",
                         toc_entry->cmdline_name,
                         toc_entry->action_arg);
            replace_image(toc_entry->image, image);
        } else {
            if (verbose)
                log_dbgx("Adding image %s",
                         toc_entry->action_arg);
            add_image(image);
        }
        /* Link backpointer from lookup entry. */
        toc_entry->image = image;

        free(toc_entry->action_arg);
        toc_entry->action_arg = NULL;
    }
}
Exemplo n.º 3
0
/*
 * This function is shared between the create and update subcommands.
 * The difference between the two subcommands is that when the FIP file
 * is created, the parsing of an existing FIP is skipped.  This results
 * in update_fip() creating the new FIP file from scratch because the
 * internal image table is not populated.
 */
static void update_fip(void)
{
	image_desc_t *desc;

	/* Add or replace images in the FIP file. */
	for (desc = image_desc_head; desc != NULL; desc = desc->next) {
		image_t *image;

		if (desc->action != DO_PACK)
			continue;

		image = read_image_from_file(&desc->uuid,
		    desc->action_arg);
		if (desc->image != NULL) {
			if (verbose) {
				log_dbgx("Replacing %s with %s",
				    desc->cmdline_name,
				    desc->action_arg);
			}
			free(desc->image);
			desc->image = image;
		} else {
			if (verbose)
				log_dbgx("Adding image %s",
				    desc->action_arg);
			desc->image = image;
		}
	}
}
Exemplo n.º 4
0
bool directoryManager::grabFrame() {
	
	if (FrameCounter1 >= int(file_list.size())) {
		if (loopMode) {
			FrameCounter1 = 0;
		} else {
			return false;
		}
	}

	std::string full_path = std::string(input_directory) + "/" + file_list.at(FrameCounter1);

	*rawImage = read_image_from_file(full_path);
	FrameCounter1++;
	
	return true;
}