struct image_cfg_element *e;
size_t headersz;
struct main_hdr_v0 *main_hdr;
- struct ext_hdr_v0 *ext_hdr;
uint8_t *image;
int has_ext = 0;
/* Generate the ext header */
if (has_ext) {
+ struct ext_hdr_v0 *ext_hdr;
int cfgi, datai;
ext_hdr = (struct ext_hdr_v0 *)
{
struct image_cfg_element *binarye;
size_t headersz;
- int ret;
/*
* Calculate the size of the header and the size of the
binarye = image_find_option(IMAGE_CFG_BINARY);
if (binarye) {
+ int ret;
struct stat s;
ret = stat(binarye->binary.file, &s);
size_t headersz;
uint8_t *image, *cur;
int hasext = 0;
- int ret;
/*
* Calculate the size of the header and the size of the
struct stat s;
int argi;
FILE *bin;
+ int ret;
hdr->headertype = OPT_HDR_V1_BINARY_TYPE;
struct image_tool_params *params)
{
struct main_hdr_v0 *main_hdr;
- struct ext_hdr_v0 *ext_hdr;
uint8_t checksum;
main_hdr = (struct main_hdr_v0 *)ptr;
/* Only version 0 extended header has checksum */
if (image_version((void *)ptr) == 0) {
+ struct ext_hdr_v0 *ext_hdr;
+
ext_hdr = (struct ext_hdr_v0 *)
(ptr + sizeof(struct main_hdr_v0));
checksum = image_checksum8(ext_hdr,