From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markus =?utf-8?Q?Klotzb=C3=BCcher?= Date: Tue, 25 Mar 2008 17:00:03 +0100 Subject: [U-Boot-Users] auto-save environment if using default environment? In-Reply-To: <47E90DE8.15445.1113A3A@w.wegner.astro-kom.de> (w. wegner's message of "Tue\, 25 Mar 2008 14\:36\:24 +0100") References: <47E90DE8.15445.1113A3A@w.wegner.astro-kom.de> Message-ID: <873aqedcak.fsf@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de w.wegner at astro-kom.de writes: > I just had the problem of fw_{print,save}env not being able to access > the environment because I was using the default (builtin) environment > after flashing U-Boot. > I wonder if I am the only one having this problem, or is it common > practice to flash the environment together with U-Boot during production? > > 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? > (I could not find a possibility to check from the command-line if > the current environment comes from flash or is the built-in default > environment, else it would be easier to make a script check and > call saveenv before booting.) AFAIK there is currently no way to check this from the U-Boot shell. Nevertheless I think that would be the way to go instead of hard-coding this. How about setting an environment variable like "env_default" if the default environment is used? That way scripts can be used to run saveenv but could also do more complex initialization. Best regards Markus Klotzbuecher -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de