Dear Stefano Babic, > Implement function vrec_header to be able to pad the final > data image file according the what has been calculated for > boot_data.length. > > Signed-off-by: Stefano Babic <sba...@denx.de> > ---
[...] > + if (!imxhdr) { > + fprintf(stderr, "%s: malloc return failure: %s\n", > + params->cmdname, strerror(errno)); > + exit(EXIT_FAILURE); > + } > + > + memset(imxhdr, 0, alloc_len); > + > + tparams->header_size = alloc_len; > + tparams->hdr = imxhdr; > + > + /* determine data image file length */ Why dont you just call stat(2) here instead of the open+fstat+close combo? > + dfd = open(datafile, O_RDONLY|O_BINARY); > + if (dfd < 0) { > + fprintf(stderr, "%s: Can't open %s: %s\n", > + params->cmdname, datafile, strerror(errno)); > + exit(EXIT_FAILURE); > + } > + > + if (fstat(dfd, &sbuf) < 0) { > + fprintf(stderr, "%s: Can't stat %s: %s\n", > + params->cmdname, datafile, strerror(errno)); > + exit(EXIT_FAILURE); > + } > + > + pad_len = ROUND(sbuf.st_size, 4096) - sbuf.st_size; > + > + close(dfd); > + > + /* TODO: check i.MX image V1 handling, for now use 'old' style */ [...] Best regards, Marek Vasut _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot