All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Mills <wmills@ti.com>
To: Darren Hart <dvhart@linux.intel.com>
Cc: Yocto Project <yocto@yoctoproject.org>
Subject: Re: [pull-sys940x 3/4] genmac: Replace RANDOM_MAC in	network/interfaces with a randomly generated MAC
Date: Thu, 2 Feb 2012 13:37:10 -0500	[thread overview]
Message-ID: <4F2AD7D6.5080407@ti.com> (raw)
In-Reply-To: <4F2AC5A6.6030002@linux.intel.com>



On 02/02/2012 12:19 PM, Darren Hart wrote:
> On 02/02/2012 06:09 AM, William Mills wrote:
>> So on a non-volatile r/w filesystem this will assign a new random mac to
>> each interface on the first boot and reuse that MAC on each subsquent boot.
> Correct.
>
>> On a volatile r/w filesystem this will use a new MAC addr for each
>> boot.  I guess thats better than nothing and not much to do on a
>> volatile system.
> Correct. The alternative would be to try and sort out some kind of hash
> based on unique data, maybe dmidecode data - but that's not very
> consistent across platforms. I think there is something like this
> available for the Beagleboard.
>
>
>> What does this do on a ro filesystem?  No network?  network with
>> 0:0:0:0:0:0 MAC addr? (horror! but I suspect the kernel won't allow
>> that).  Certainly this script failing should not cause the rest of boot
>> to fail.
> On a read only filesystem with genmac installed and RANDOM_MAC in the
> interfaces file, genmac will run and NOT update interfaces. This was
> written with the pch_gbe driver in mind. If no MAC is in the EEPROM, the
> pch_gbe driver leaves the MAC as 00:00:00:00:00:00 and leaves the
> interface down. It will fail any up command until the MAC has been set.
> So the subsequent networking script will fail to bring up the relevant
> interface. ifconfig -a will list the interface as down and with a MAC of
> 00:00:00:00:00:00.
>
> Other drivers will assign a random MAC within the kernel, making this
> all unnecessary, but David Miller refused this patch for this driver
> (despite the precedent).
>
> If you want to use a RO image on a platform with a pch_gbe nic and no
> EEPROM, you need to hardcode the generated MAC in the interfaces file.
>
> The alternative would be for me to call this pch_gbe_genmac and have it
> call ifconfig directly instead of delegating it to the interfaces file.
> But then I would still want to use a config file to store the
> first-boot-generated MAC so it was the same across boots. Once I have to
> generate a config file, I felt it made more sense to just use
> interfaces, and then it makes sense to make it generic (not pch_gbe
> specific), and that led me to this implementation.
>
> Seem reasonable?
>

Yes I think so.  Just wanted to make sure it failed gracefully.   I 
think your doing the best that can be expected.

Thanks for the detail.

[I'm interested as I have a board that might need this.  Not in OE yet, 
but someday ...]



  reply	other threads:[~2012-02-02 18:37 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-01 22:26 [pull-sys940x 0/4][meta-intel] Inforce SYS940X BSP (Intel Atom E6xx + EG20T) Darren Hart
2012-02-01 22:26 ` [pull-sys940x 1/4] meta-intel: Add Inforce SYS940x BSP Darren Hart
2012-02-01 22:37   ` Joshua Lock
2012-02-01 23:05     ` Joshua Lock
2012-02-02 18:07       ` Darren Hart
2012-02-01 22:26 ` [pull-sys940x 2/4] ranpwd: Add ranpwd recipe Darren Hart
2012-02-01 22:40   ` Joshua Lock
2012-02-02  7:22     ` Martin Jansa
2012-02-02 18:26       ` Darren Hart
2012-02-02 19:13         ` Joshua Lock
2012-02-02 19:34           ` Darren Hart
2012-02-02 18:24     ` Darren Hart
2012-02-02 19:24       ` Joshua Lock
2012-02-02 19:32         ` Darren Hart
2012-02-02 21:11           ` Joshua Lock
2012-02-06 16:17             ` Paul Eggleton
2012-02-06 23:59               ` Joshua Lock
2012-02-07  7:06                 ` Martin Jansa
2012-02-07  9:20                   ` [yocto] " Koen Kooi
2012-02-11  0:14                   ` Darren Hart
2012-02-11  1:45                     ` Khem Raj
2012-02-01 22:26 ` [pull-sys940x 3/4] genmac: Replace RANDOM_MAC in network/interfaces with a randomly generated MAC Darren Hart
2012-02-01 22:42   ` Joshua Lock
2012-02-02 18:27     ` Darren Hart
2012-02-02 14:09   ` William Mills
2012-02-02 17:19     ` Darren Hart
2012-02-02 18:37       ` William Mills [this message]
2012-02-01 22:26 ` [pull-sys940x 4/4] netbase: Add interfaces with RANDOM_MAC for sys940x* machines Darren Hart
2012-02-01 22:52   ` Joshua Lock
2012-02-01 23:03     ` Joshua Lock
2012-02-02 18:31       ` Darren Hart
2012-02-02 19:02       ` Joshua Lock

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=4F2AD7D6.5080407@ti.com \
    --to=wmills@ti.com \
    --cc=dvhart@linux.intel.com \
    --cc=yocto@yoctoproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.