[Bug 195692] Feature request: Make devd read MAC addresses
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Fri Dec 5 15:04:03 UTC 2014
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195692
Warner Losh <imp at FreeBSD.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |imp at FreeBSD.org
--- Comment #2 from Warner Losh <imp at FreeBSD.org> ---
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...
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-standards
mailing list