From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.121]:39995 "EHLO cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750985Ab0APIpT (ORCPT ); Sat, 16 Jan 2010 03:45:19 -0500 Message-ID: <4B517A95.9090908@ca.rr.com> Date: Sat, 16 Jan 2010 00:36:37 -0800 From: Dan Taylor Reply-To: danieltaylor@acm.org MIME-Version: 1.0 To: linux-media@vger.kernel.org Subject: Re: Order of dvb devices Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org List-ID: 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: > > [lamikr@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 majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >