Matt Burgess wrote:
> On Wed, 2013-02-13 at 15:28 -0600, Bruce Dubbs wrote:
>> Matt Burgess wrote:
>>
>>>
>>> I think that's the problem.  My host (Fedora 18) calls my eth0 device
>>> p5p1.
>>
>> What on earth are they doing?  The link
>> http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames
>> indicates names starting with en.  Without the en, it doesn't make
>> things very predictable.
>
> Oh, it's completely predictable, as long as you understand that Fedora's
> rules appear to be different than upstreams :-)
>
> http://fedoraproject.org/wiki/Features/ConsistentNetworkDeviceNaming#User_Experience
>  - as it's detected as a PCI device, it gets prefixed with 'p', it's detected 
> as being in slot 5 and port 1 so therefore becomes p5p1, easy eh? :-)
>
> Apparently, I can disable this by adding 'biosdevname=0' to my kernel
> command line.  I'm not sure we can rely on that having been done though.
>
>>> So, when I run ./init-net-rules.sh, none of the DEVICES strings
>>> match, so it only picks up my wlan0 device and populates
>>> 70-persistent-net.rules with that.  That leaves 80-net-name-slot.rules
>>> to do its thing, and give me the rather unpleasant enp7s0 device name.
>>
>>> Now, once I'm booted into LFS, and run init-net-rules.sh again, my
>>> 70-persistent-net.rules is populated with both my Ethernet & Wlan cards,
>>> but the Ethernet device is once again going to get a name of enp7s0.
>>
>> After a 2nd reboot?
>
> Yes, the rule generated in 70-persistent-net.rules is:
>
> # net device r8169
> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
> ATTR{address}=="5c:9a:d8:57:75:2e", ATTR{dev_id}=="0x0",
> ATTR{type}=="1", KERNEL=="enp*", NAME="enp7s0"

Do you have /sys/class/net/enp7s0?

> So, it will always be crap no matter how many times I reboot (oh, if
> only this were Windows, a random number of reboots might get it to be
> correct :-) )
>>> I
>>> can only assume this is /lib/udev/write_net_rules (called toward the end
>>> of init-net-rules.sh) doing this?
>>
>> Yes, that writes 70-persistent-net.rules.
>
> So it is write_net_rules that is generating that stupid NAME= value into
> the rules file?  If so, due to the ATTR{address} match, I can easily
> change that back to 'eth0', but I'd like that to be done automagically,
> if possible.

It's picking that up from /sys/class/net/.  If the rules are ensuring 
that the device name is always enp7s0, then only the IFACE variable in 
/etc/sysconfig/ifconfig.eth0 needs to be changed and the 
70-persistent-net.rules file is not needed at all.

I do wonder if the interface name will change depending on the kernel. 
That is, will the value still be enp7s0 when booted with a cusomized kernel?

I'm not sure how to generalize this and address it in the book.

   -- Bruce

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to