I have been struggling with this problem: https://docs.freebsd.org/cgi/getmsg.cgi?fetch=615680+0+current/freebsd-net Which eventually lead me to use devd to solve the problem, however the ONLY reason I could solve it was because the vendor actually provided a unique serial number for each device. Now, coming from Linux with 70-persistent-net.rules, in which devices can be matched and fixed for udev using their MAC addresses, I cannot imagine how easy it would have been to solve this problem had devd been able to read MAC addresses. IMHO, and in all respect, it makes absolutely no sense that devd can get the device vendor, product, serialnumber, etc, but not the MAC address. This would be extremely useful. So hence this feature request. Kindest regards.
Not to mention, which I forgot, most vendor does NOT provide a unique serial number! Hence, the MAC address is really important to be able to get from devd.
The MAC isn't a published piece of data in newbus. The data exists at the wrong layer for newbus to access it. devd operates only at the newbus level for most things. However, devd doesn't care or need to care. Just invoke a script whenever you get a ueX device. This script does a lookup on the MAC address using ifconfig. It can then rename it to whatever it wants for the fixup. % cat /etc/ifmap 00:25:90:34:54:32 fred 00:25:90:34:44:23 barney 00:25:90:33:45:06 wilma % cat fix-name #!/bin/sh dev=$1 mac=$(ifconfig $dev | grep ether | awk '{print $2;}') name=$(grep ^$mac /etc/ifmap | awk '{print $2;}') if [ -n $name ]; then ifconfig $dev name $name fi % which seems simple and straight forward enough...
I agree this would work. Nice solution based upon this: https://docs.freebsd.org/cgi/getmsg.cgi?fetch=778441+0+current/freebsd-net Thanks!
(In reply to greencoppermine from comment #3) Hi, you gave a link to a working solution, but the link is dead. Do you happen to remember more info? Got a similar issue (hub full of usb2serial's) and don't yet understand to convince devd to do the right things. (call a script it seems)