[U-Boot] [PATCH 6/7] tools, fit: add fit_info host command

Marek Vasut marex at denx.de
Wed Feb 12 11:46:02 CET 2014


On Monday, February 10, 2014 at 07:28:51 AM, Heiko Schocher wrote:
> Hello Marek,
> 
> Am 08.02.2014 15:16, schrieb Marek Vasut:
> > On Saturday, January 25, 2014 at 07:44:28 AM, Heiko Schocher wrote:
> >> add fit_info command to the host tools. This command prints
> >> the name, offset and the len from a property from a node in
> >> a fit file. This info can be used to extract a properties
> >> data with linux tools, for example "dd".
> >> 
> >> Signed-off-by: Heiko Schocher<hs at denx.de>
> > 
> > [...]
> > 
> >> +int mmap_fdt(char *cmdname, const char *fname, void **blobp,
> >> +		struct stat *sbuf)
> >> +{
> >> +	void *ptr;
> >> +	int fd;
> >> +
> >> +	/* Load FIT blob into memory (we need to write hashes/signatures) */
> >> +	fd = open(fname, O_RDWR | O_BINARY);
> >> +
> >> +	if (fd<  0) {
> >> +		fprintf(stderr, "%s: Can't open %s: %s\n",
> >> +			cmdname, fname, strerror(errno));
> >> +		unlink(fname);
> > 
> > Are you sure about this unlink() call here ? The unlink() might delete
> > the file, dunno if that was intended ;-)
> 
> Heh.. good catch! I only moved this function from tools/fit_image.c
> to a common place, so other function can use it too ... but I just
> noticed, I do not really need this ...

[...]

> Seems this function needs a rework! I drop this from my patch, as I
> do not need it.

Thanks!

Best regards,
Marek Vasut


More information about the U-Boot mailing list