Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Dec 2014 15:04:02 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-standards@FreeBSD.org
Subject:   [Bug 195692] Feature request: Make devd read MAC addresses
Message-ID:  <bug-195692-15-uzxQOb5ZeN@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-195692-15@https.bugs.freebsd.org/bugzilla/>
References:  <bug-195692-15@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195692

Warner Losh <imp@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |imp@FreeBSD.org

--- Comment #2 from Warner Losh <imp@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-195692-15-uzxQOb5ZeN>