How to change MAC address on RPI-B?

Ian Lepore ian at freebsd.org
Sat Nov 26 05:19:00 UTC 2016


On Sat, 2016-11-26 at 00:07 +0100, diffusae wrote:
> Hi John,
> 
> On 25.11.2016 20:56, John W. Kitz wrote:
> 
> > 
> > So when doing so the locally administered MAC address is passed on
> > from
> > uEnv.txt to the O/S during boot and is then used to override the
> > globally
> I didn't think, that it will be passed from the U-Boot Enviroment
> settings. You can set the MAC address, but the FreeBSD kernel shows
> always the unique MAC address.
> 
> > 
> > unique MAC address or does the O/S check both the information found
> > in its
> > configuration files and what is configured in uEnv.txt before
> > configuring
> > and activating the network interface(s)?
> Which configuration files do you mean? AFAIK there is only the FDT
> blob.
> I guess it ignores the setting in uEnv.txt.
> 
> > 
> > Makes me wonder which of the two (i.e. locally administered through
> > uEnv.txt
> > or locally administered through the O/S) takes precedence.
> Only the unique MAC address and the locally administered MAC address,
> will take affect.
> 
> > 
> > In addition this might affect configuration decisions when one
> > would want to
> > configure a device for net booting (at least when browsing through
> > what can
> > be configured by means of uEnv.txt I believe that was one of the
> > options I
> > saw) through uEnv.txt?
> Personally, I like u-boot. It has various options, runs on a lot of
> devices and it's also nice to handle.
> 
> Best regards,
> _

I looked into this tonight, and there is some code missing in u-boot to
handle passing a mac address set in the u-boot environment into the
kernel via the fdt data.

It would be pretty simple to fix.  We need to add an ethernet0 alias
pointing to the /axi/usb/hub/ethernet node to our rpi dts, and the
attached patch needs to replace the current one in the u-boot-rpi port.

This lets you set usbethaddr in the u-boot environment (via uEnv.txt or
saved directly using saveenv), and it will get used by both u-boot and
freebsd.

Having gotten it this far, I don't really have time right now to get
the patch committed to ports.  Hopefully somebody else can help with
that.

-- Ian


More information about the freebsd-arm mailing list