[U-Boot] [PATCH] cmd_nand/cmd_ubi/cmd_nboot: Set environment variable 'filesize'

Tom Rini trini at ti.com
Wed Jul 16 22:50:54 CEST 2014


On Wed, Jul 16, 2014 at 02:45:23PM +0200, Wolfgang Denk wrote:
> Dear Rostislav Lisovy,
> 
> In message <1405500531-25486-1-git-send-email-lisovy at merica.cz> you wrote:
> > The environment variable 'filesize' is commonly used for
> > storing information about the size of the last read/retrieved
> > file. The variable is essential when writing U-boot scripts.
> > This patch adds the capability of storing the information about
> > the size of read data into the 'filesize' variable for other
> > commands (nand read/ubi read/nboot) as well.
> 
> I'm not happy with that.  I think this is actually dangerous.
> 
> First, you mix two different concepts here.  As the name "FILEsize"
> suggests, it is related to the size of a data object "file".  This
> comes as natural name when loading data from a TFTP server or when
> reading a *file* from some file system.  Extending this to mean any
> amount of data looks inconsistent and even broken to me.
> 
> Second, there might be scripts out there which get broken by your
> modification.  For example, when I download a file over TFTP to RAM, I
> expect that "filesize" holds the exact amount of bytes of this file.
> When I now use "nand write ... +${filesize}", the write size would be
> rounded up to the next full erase block size of the NAND.  Any later
> reference to "filesize" will now see a different (larger) value than
> expected.
> 
> There are problably other scenarios which may get broken by such
> unexpected (and new) behaviour.

I agree we should NOT modify filesize on write.  But what about on
NAND/etc read?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140716/b04d23a5/attachment.pgp>


More information about the U-Boot mailing list