[U-Boot] [PATCH] fw_env.c: use default env values if config file cannot be opened

Frans Meulenbroeks fransmeulenbroeks at gmail.com
Thu Jan 5 16:41:10 CET 2012


2012/1/5 Wolfgang Denk <wd at denx.de>

> Dear Frans Meulenbroeks,
>
> In message <1325098913-29909-1-git-send-email-fransmeulenbroeks at gmail.com>
> you wrote:
> > If the config file cannot be opened currently one gets an error
> > even though the build in names/sizes are probably ok.
> > By setting the default values first and only exit if there
> > is a read error and not when the config file can be opened
> > the program will try the default settings.
>
> I have to admit that I don't like this change of behaviour.  When
> configured for use with a config file, all errors should be treated
> the same.
>
> But that's just my $ 0.02.
>
>
> Are there any other opinions / votes how to proceed here?
>
> Best regards,
>
> Wolfgang Denk
>
>
> As you mentioned in another reply the common practice nowadays seems to be
to use a conf file.
This has the disadvantage that the conf file can get lost or misplaced.
For embedded systems I would prefer compiled-in values (or maybe an
autosensing version that just seeks into /dev/mtd0 or so to find the actual
location of the environment, if the sector size is known it would not be
too hard.

BTW: it could also be argued that the specification of the config file
should be in the board config, not in fw_env.h.

Frans


More information about the U-Boot mailing list