[U-Boot] [RFD] store env size in env area (+ cookie + len)
Matthias Weißer
weisserm at arcor.de
Thu Aug 12 10:11:18 CEST 2010
Am 12.08.2010 09:54, schrieb Frans Meulenbroeks:
> 2010/8/12 Matthias Weißer<weisserm at arcor.de>:
>> Why not store the size of the environment sector as env variable? The size
>> should be only needed for storing the environment and not for loading (as it
>> is terminated by a '\0'). So we could load the environment, check for
>> "env_size" and if its not there take the value from fw_env.config
>
> Currently the crc of the environment is calculated and if it does not
> match with the stored crc the default environment is used.
> For determining the crc the size is needed so storing the size in the
> env creates some form of catch-22. Of course the code could be
> modified to first peek at the unverified env to find the size.
> That is a different approach. Imho not too neat.
I see. I was thinking that the CRC is only calculated over the
environment until the '\0' end mark is reached. But after checking my
environment code I see that the CRC is calculated over the whole sector.
> Wrt the format: I understood from the mail from Reinhard that the way
> the env is stored is going to change anyway. I saw the patches of
> Wolfgang pass by, but didn't have time to study them yet.
I also didn't go that deep into Wolfgangs patches but from what I
understand the "on disk format" will not change. Will it?
Maybe the size could be added at the end of the environment (behind the
'\0'). So we wouldn't loose compatibility.
Matthias
More information about the U-Boot
mailing list