public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Wegner <wolfgang@leila.ping.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] auto-save environment if using default environment?
Date: Wed, 26 Mar 2008 00:15:14 +0100	[thread overview]
Message-ID: <20080325231514.GA19940@leila.ping.de> (raw)
In-Reply-To: <20080325201613.8D7E8248BF@gemini.denx.de>

Hi Wolfgang,

On Tue, Mar 25, 2008 at 09:16:13PM +0100, Wolfgang Denk wrote:
> 
> Quite a number of boards  use  an  embedded  environment  which  gets
> auto-installed  when  programming the U-Boot image. And a significant
> percentage of boards I know use some installation tool that will  set
> up  things like serial number, MAC addresses etc. one way or another,
> andin many cases this includes running "saveenv".

with "installation tool" you mean any kind of interaction from the
U-Boot command prompt, correct? (Just for clarification on my side)
In my current application there (unfortunately) there is no hardware
serial number anyways, and no ethernet, so no data that would have to
be set for each device seperately.

> > I just made this small patch to auto-save the environment if it is
> > not found in flash but am wondering if
> > - I missed something and such a possibility does already exist?
> 
> No, and I strongly discourage it. It just makes detection of certain
> types of problems / hardware errors etc. more difficult or even
> impossible.
> 
> > - something similar might be worth considering as a new regular feature?
> 
> I think I would oppose such a change because I consider it really
> dangerous.

I think I get your point here, and especially as now Markus pointed
me to a possible solution just using the command shell I perfectly agree
that having it built-in like in my patch is just a source of possible
problems, not needed and thus not a good idea.

On the other hand (and taking into account your answer to Markus),
sometimes an automatic approach might have its use, too:

On our board we have an FPGA, and for different applications a different
FPGA file shall be loaded without updating the firmware. For this, the
application has to set an U-Boot environment variable that specifies which
FPGA file to load on next boot.
But, I do not want the application to mess around with the building the
complete environment, instead, it shall just modify the existing variables.
So, as I trust U-Boot more than my application, I want U-Boot to always
initialize the environment stored in flash, and have the application just
update the single variable - but this implies that even if the application
failed during updating the environment (be it because of a software fault
or power failure or whatever reason), U-Boot has to re-write this on the
next power-up in case it detects the flash environment is invalid.

I think there may also be different opinions about which is the best
solution here, but especially because the environment holds vital data
like bootcmd etc., for me this looks like the most secure solution although
I do not know if U-Boot already claims to have a brain. ;-)

Best regards,
Wolfgang

  reply	other threads:[~2008-03-25 23:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-25 13:36 [U-Boot-Users] auto-save environment if using default environment? w.wegner at astro-kom.de
2008-03-25 15:24 ` Jean-Christophe PLAGNIOL-VILLARD
2008-03-25 15:36   ` w.wegner at astro-kom.de
2008-03-25 16:00 ` Markus Klotzbücher
2008-03-25 16:18   ` w.wegner at astro-kom.de
2008-03-25 20:23   ` Wolfgang Denk
2008-03-25 20:16 ` Wolfgang Denk
2008-03-25 23:15   ` Wolfgang Wegner [this message]
2008-03-25 23:49     ` Aras Vaichas
2008-03-26  7:28       ` Markus Klotzbücher
2008-03-26  4:51 ` Mike Frysinger
2008-03-26  7:30   ` Wolfgang Denk
2008-03-26 14:49     ` Mike Frysinger
2008-03-26 15:01       ` Wolfgang Denk
2008-03-30 20:28         ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080325231514.GA19940@leila.ping.de \
    --to=wolfgang@leila.ping.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox