Mika Laitio wrote:
True, the ordering is not exactly the same everytime. One will need to
provide PCI Bus related info also to a practical udev configuration to
get things sorted out in a sane way, rather than anything else.

At least in Mandriva, the order and naming of network adapters are handled by 
using a this kind of udev rule which prevents for example eth0 and eth1 to swap 
between boots:

[lam...@iiris rules.d]$ cat 70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# Drakx-net rule for eth0 (00:24:e8:9e:66:13)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:11:22:33:44:55", 
ATTR{type}=="1", KERNEL=="eth*", NAME="eth0

# PCI device 0x8086:0x4232 (iwlagn)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="11:22:33:44:55:66", ATTR{type}=="1", 
KERNEL=="wlan*", NAME="wlan0""

I am not sure whether udev rules itself can originally generate this file or 
whether it's mandriva's own tools/scripts that will generate this file and add 
all new adapters it finds that are not yet in the file.

Mika


The eth drivers have one advantage:  nearly all of them have an
associated MAC address, which is (supposed to be, anyway) globally
(the planet, not just the system) unique.  It is, therefore, easy
enough to associate a specific NIC with a specific name, as shown.

If we keep some sort of configuration table:

For those boards that have eeproms, and for which the eeprom contains
a serial number, or other unique identifier, we could do the same thing.

Alternatively, we could use the PCI address (bus/device/unit).

USB devices can have serial numbers, but it isn't common.

Sounds like we need to think about keeping a table, having some udev
rules to work with it, and some utility to manage it.

RFQ time?

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to