8.0 kernel fails to build if some USB drivers are trimmed out;
error in /sys/conf/files
Jeremy Chadwick
freebsd at jdc.parodius.com
Thu Nov 26 18:44:10 UTC 2009
On Thu, Nov 26, 2009 at 10:43:13AM -0700, Brett Glass wrote:
> I encountered a strange bug when I was "trimming" the GENERIC FreeBSD
> RELEASE-8.0 kernel to omit drivers for hardware that would not be used on one
> target platform. I removed all of the USB Ethernet drivers except for "udav"
> (Davicom USB Ethernet) and tried to rebuild the kernel. The build stopped at
> the point where the kernel was linked, reporting undefined references in the
> file /sys/usb/net/if_udav.c to "uether_pause", "uether_ifdetach",
> "uether_getmii", and other routines with similar names. I discovered that
> these functions are defined in the file usb_ethernet.c, which is in the same
> directory as if_udav.c.
Missing symbols are almost always the sign of a missing "device" directive inside
of the kernel configuration file. In this case, they're part of
sys/dev/usb/net/usb_ethernet.[ch], which should be being built.
You absolutely need to include the following devices in addition to "device udav":
device ether
device miibus
I assume you did leave "device usb" and related pieces (meaning lines
around that area) intact.
Keeping it simple: can we see your kernel configuration file in its
entirety? It isn't included in the PR, nor in this Email.
> More experimentation seems to indicate that the GENERIC kernel builds by sheer
> luck, due to an odd quirk in the "config" utility.
I haven't used "config" since the early 3.x days. I'm certain "make
buildkernel" and friends relies on it, but configuring a kernel +
building a kernel is a lot simpler now. Read /usr/src/Makefile,
starting with the line "For individuals wanting to upgrade their
sources". The steps there are accurate.
I don't think parenthesis are the core of the problem, given that there
are many other devices in /sys/conf/files which utilise said method.
--
| Jeremy Chadwick jdc at parodius.com |
| Parodius Networking http://www.parodius.com/ |
| UNIX Systems Administrator Mountain View, CA, USA |
| Making life hard for others since 1977. PGP: 4BD6C0CB |
More information about the freebsd-stable
mailing list