mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: barebox@lists.infradead.org
Subject: Re: Setting MAC address from nv variable broken in barebox 2017.05.0?
Date: Mon, 8 May 2017 15:45:49 +0100	[thread overview]
Message-ID: <4208aa68-1cb6-0224-781a-4572a78ba6fd@mev.co.uk> (raw)
In-Reply-To: <91e8e828-d3c3-5c56-0a92-a52c493b8354@mev.co.uk>

On 08/05/17 14:39, Ian Abbott wrote:
> Hi,
>
> I'm not sure if this is a bug or whether I'm doing something wrong.  In
> barebox 2017.04.0 and earlier, I stored the Ethernet MAC address in a
> non-volatile ('nv') variable dev.eth0.macaddr=xx:xx:xx:xx:xx:xx and that
> got propagated to 'global' and the eth0 device on boot:
>
> barebox@xxxx:/ nv
>   allow_color: true
>   autoboot_timeout: 3
>   dev.eth0.ethaddr: xx:xx:xx:xx:xx:xx
>   user: none
[snip]
> However, in 2017.05.0, my 'dev.eth0.ethaddr' variable is no longer being
> propagated to global on boot, and as a consequence, is no longer
> propagated to eth0 (note that 'dev.eth0.ethaddr' is the only nv variable
> that I set manually when setting up a new board):
>
> barebox@xxxx:/ devinfo eth0
> Parameters:
>   ethaddr: 00:00:00:00:00:00
>   gateway: 0.0.0.0
>   ipaddr: 0.0.0.0
>   linux.bootargs:
>   netmask: 0.0.0.0
>   serverip: 0.0.0.0
>
[snip]
> Is this the proper behaviour or a bug?  Could it be related to commit
> 35d8e858bea17ec4796069c9c27fd0b134125eaf ("nv: Do not create globalvars
> from nvvars")?

As a related follow-up, this code in globalvar_add_simple() looks a bit 
strange:

	if (value)
		dev_set_param(&global_device, name, value);

	globalvar_nv_sync(name);

If you set a new global variable with a specified value and there is an 
existing nv variable of the same name, the global variable will be set 
to the value of the nv variable, rather than the specified value:

barebox@xxxx:/ nv -r quux
barebox@xxxx:/ global -r quux
barebox@xxxx:/ nv quux=foo
barebox@xxxx:/ global quux=bar
barebox@xxxx:/ echo ${global.quux}
foo

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2017-05-08 14:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-08 13:39 Ian Abbott
2017-05-08 14:34 ` Sascha Hauer
2017-05-08 15:44   ` Ian Abbott
2017-05-08 14:45 ` Ian Abbott [this message]
2017-05-08 14:49   ` Ian Abbott
2017-05-08 18:12   ` Sascha Hauer
2017-05-09 10:02     ` Ian Abbott
2017-05-11  6:17       ` Sascha Hauer
2017-05-11  9:48         ` Ian Abbott

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=4208aa68-1cb6-0224-781a-4572a78ba6fd@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=barebox@lists.infradead.org \
    /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