[U-Boot] [PATCH v2 3/4] tools: mkimage: kwbimage list command support

Wolfgang Denk wd at denx.de
Wed Jul 22 12:41:02 CEST 2009


Dear Prafulla Wadaskar,

In message <73173D32E9439E4ABB5151606C3E19E202DDF277BE at SC-VEXCH1.marvell.com> you wrote:
> 
> > When exporting this function, then please add prototype to 
> > header file.
> I have followed function crc32, I will do it.

Ah, I see. 

> Shall I do it for crc32 and other functions too? I should not disturb them?

If you would be so kind and clean up these other function declarations
as well, that would be much appreciated. Thanks in advance.

...
> > > +		if (!(kwbimage_check_header ((struct kwb_header 
> > *)ptr))) {
> > > +			kwbimage_print_contents ((struct 
> > kwb_header *)ptr);
> > > +			exit (EXIT_SUCCESS);
> > 
> > I think you should add error checking here. For example, when 
> > the code detects a corruption of the image (checksum error or 
> > the like), it should return an error code here, so you can 
> > use "mkimage -l" to actually verify the consistency of an 
> > image (in automated scripts).
> Currently mkimage checks first kwbimage header followed by ftd/fit header c
> hecks
> In that case returning an error code will not be useful

I don't understand what you mean here. Any corruption of an image
should be detected and signalled to the caller by a non-zero return
code of the mkimage command.

> On the other hand,
> we should detect filename extension (img/kwb) from input file and then only
>  do relevant image checks.

NO!! Never do anything like that. File names don't matter at all.
We're not Windows, where just naming your virus code as "document.txt"
will make it look harmless. Only the content matters - if the file is
called "image.foo" or just "foo" or "sjjsdhashd" does not matter at
all.

> Filenames can be altered so I think current implementation is okay.
> What do you think?

Filenames must not play any role.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Sometimes a feeling is all we humans have to go on.
	-- Kirk, "A Taste of Armageddon", stardate 3193.9


More information about the U-Boot mailing list