[U-Boot] fw_setenv writes to bootdelay but not ethaddr

Mike Frysinger vapier at gentoo.org
Tue Apr 10 06:39:50 CEST 2012


On Sunday 08 April 2012 18:16:51 Bishop, Mark wrote:
> > -----Original Message-----
> > From: Mike Frysinger [mailto:vapier at gentoo.org]
> > Sent: Sunday, April 08, 2012 5:32 PM
> > To: Bishop, Mark
> > Cc: u-boot at lists.denx.de
> > Subject: Re: [U-Boot] fw_setenv writes to bootdelay but not ethaddr
> > 
> > On Sunday 08 April 2012 17:15:26 Bishop, Mark wrote:
> > > From: Mike Frysinger [mailto:vapier at gentoo.org]
> > > 
> > > > On Thursday 05 April 2012 16:32:11 Bishop, Mark wrote:
> > > > > root:/>  fw_setenv ethaddr X1:X2:X3:X4:X5:X6 Can't overwrite
> > > > > "ethaddr"
> > > > 
> > > > looks correct to me.  you probably didn't set CONFIG_ENV_OVERWRITE.
> > > 
> > > I wish it was so:
> > > #define CONFIG_ENV_OVERWRITE    1
> > > is present in my board file.
> > > 
> > > I've checked to make sure that it is the correct header file.  I've
> > > also checked to make sure that CONFIG_OVERWRITE_ETHADDR_ONCE is not
> > 
> > set.
> > 
> > > I'm using the slightly outdated uclinux uboot from their head repo
> > 
> > and
> > 
> > > I am checking the patches applied to the uboot head if any were to
> > 
> > fix
> > 
> > > something like this.
> > 
> > sorry, should have been a little clearer.  the tools installed by
> > uclinux-dist do not have a config, so it uses the default one.  the
> > CONFIG_xxx settings in your u-boot don't get used.  fw_printenv has to
> > be built with those config settings.
> > -mike
> 
> The entire conditional in fw_env_write() is wacked out.
> 
> If the value is already set, then it never sets it again.
> 
> .....
> 			if ((oldval = envmatch (name, env)) != NULL)
>                         break;
>         }
> 
>         /*
>          * Delete any existing definition
>          */
>         if (oldval) {
>                 /*
>                  * Ethernet Address and serial# can be set only once
>                  */
>                 if ((strcmp (name, "ethaddr") == 0) ||
>                         (strcmp (name, "serial#") == 0)) {
>                         fprintf (stderr, "Can't overwrite \"%s\"\n", name);
>                         errno = EROFS;
>                         return -1;
> .........
> 
> I would have expected it to use a #ifdef CONFIG_OVERWRITE_ETHADDR_ONCE, but
> this is only supposed to be an example.

maybe the code base you're using is old.  when i look at u-boot mainline, i 
see that being protected by "#ifndef CONFIG_ENV_OVERWRITE".

> I am just going to remove the guard and move on.

should be fine as well
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120410/61a3cbbd/attachment.pgp>


More information about the U-Boot mailing list