On 8/29/06, Peter Ennis <[EMAIL PROTECTED]> wrote:
LFS 6.2 Capitalization Issue: ===================== 7.13.1. Creating stable names for network interfaces ^ ^ ^ ^
Thanks.
Udev Stuff: =========== Reading section 7.13.1 it mentions "If you are going to use the bus position as a key, create Udev rules similar to the following" however, there is no information provided on how to get the bus position (1) or why you would want to (3). Some googling and info from gregkh (2) provided answers. For the previous section a command is provided to get MAC info. The useful commands are lspci and scanpci. An example output from my system below shows how this maps to the info needed for section 7.13.1
The problem is that these aren't guarenteed to be there on the host and we don't build them in LFS. But, you can get the same info from sysfs. I couldn't figure a really slick way to do this. Maybe Alexander knows better. Here's one way to do it. $ ls -l /sys/class/net/*/device lrwxrwxrwx 1 root root 0 2006-08-29 06:50 /sys/class/net/eth0/device -> ../../../devices/pci0000:00/0000:00:0f.0 I've only got one network device. It's the eth0 device. It's on the pci bus and it's bus address is 0000:00:0f.0. Another thing to do is ask udevinfo about a specific device path. The only problem with this is that you have to know the existing interface name. The bus address is the ID of the parent device. $ udevinfo -a -p /class/net/eth0 Udevinfo starts with the device specified by the devpath and then walks up the chain of parent devices. It prints for every device found, all possible attributes in the udev rules key format. A rule to match, can be composed by the attributes of the device and the attributes from one single parent device. looking at device '/class/net/eth0': KERNEL=="eth0" SUBSYSTEM=="net" SYSFS{weight}=="0" SYSFS{tx_queue_len}=="1000" SYSFS{flags}=="0x1023" SYSFS{mtu}=="1500" SYSFS{operstate}=="unknown" SYSFS{dormant}=="0" SYSFS{carrier}=="1" SYSFS{broadcast}=="ff:ff:ff:ff:ff:ff" SYSFS{address}=="00:05:5d:e5:ae:08" SYSFS{link_mode}=="0" SYSFS{type}=="1" SYSFS{features}=="0x0" SYSFS{ifindex}=="2" SYSFS{iflink}=="2" SYSFS{addr_len}=="6" looking at parent device '/devices/pci0000:00/0000:00:0f.0': ID=="0000:00:0f.0" BUS=="pci" DRIVER=="sundance" SYSFS{modalias}=="pci:v00001186d00001002sv00001186sd00001002bc02sc00i00" SYSFS{local_cpus}=="1" SYSFS{irq}=="10" SYSFS{class}=="0x020000" SYSFS{subsystem_device}=="0x1002" SYSFS{subsystem_vendor}=="0x1186" SYSFS{device}=="0x1002" SYSFS{vendor}=="0x1186" looking at parent device '/devices/pci0000:00': ID=="pci0000:00" BUS=="" DRIVER=="" What do you think, Peter? -- Dan -- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page