>>>>> "Wolfgang" == Wolfgang Denk <[EMAIL PROTECTED]> writes:

Hi,

 Wolfgang> Hm... but lseek() on /dev/mtdblockN will return the size of
 Wolfgang> the MTD device, not of the image that may be stored in it,
 Wolfgang> right?

Yes.

 Wolfgang> Later, you should get data checksum errors because of the
 Wolfgang> incorrect lenght, i.  e.  a ``ERROR: "<image>" has
 Wolfgang> corrupted data!'' error message.

Exactly, hence my other patch (tools/mkimage: ignore trailing garbage)
to only error out if the size is smaller than the size defined in the
header.

 Wolfgang> I don't think this works.

 >> -           if (fstat(ifd, &sbuf) < 0) {
 >> -                   fprintf (stderr, "%s: Can't stat %s: %s\n",
 >> +           sbuf.st_size = lseek(ifd, 0, SEEK_END);
 >> +           if (sbuf.st_size == (off_t)-1) {
 >> +                   fprintf (stderr, "%s: Can't get size of %s: %s\n",

 Wolfgang> If you don't use *stat(), you should not use any struct
 Wolfgang> stat type either.

Ok, I kept it like that to keep the patch as minimal as possible -
I'll change it and resend.

-- 
Bye, Peter Korsgaard
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to