Re: [U-Boot] [PATCH] tools/mkimage: use lseek rather than fstat for file size for -l option

2008-12-03 Thread Peter Korsgaard
Wolfgang == Wolfgang Denk [EMAIL PROTECTED] writes: Hi, 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 This doesn't make sense to me. If we have a way to check Wolfgang the

Re: [U-Boot] [PATCH] tools/mkimage: use lseek rather than fstat for file size for -l option

2008-12-02 Thread Peter Korsgaard
Thomas == Thomas De Schampheleire [EMAIL PROTECTED] writes: Thomas I'd change the error message as well, to be independent of the tool Thomas used to get the file size. For example: Thomas fprintf (stderr, %s: Can't get size of %s: %s\n, Ahh yes, good idea. From

Re: [U-Boot] [PATCH] tools/mkimage: use lseek rather than fstat for file size for -l option

2008-12-02 Thread Wolfgang Denk
Dear Peter Korsgaard, In message [EMAIL PROTECTED] you wrote: Thomas == Thomas De Schampheleire [EMAIL PROTECTED] writes: Thomas I'd change the error message as well, to be independent of the tool Thomas used to get the file size. For example: Thomas fprintf (stderr, %s: Can't get size

Re: [U-Boot] [PATCH] tools/mkimage: use lseek rather than fstat for file size for -l option

2008-12-02 Thread Peter Korsgaard
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

[U-Boot] [PATCH] tools/mkimage: use lseek rather than fstat for file size for -l option

2008-12-01 Thread Peter Korsgaard
Use lseek rather than fstat for file size for list mode, so mkimage -l /dev/mtdblockN works (stat returns st_size == 0 for devices). Notice that you have to use /dev/mtdblockN and not /dev/mtdN, as the latter doesn't support mmap. Signed-off-by: Peter Korsgaard [EMAIL PROTECTED] ---