conf/140904: Kernel fails to build if some unused USB Ethernet interfaces are omitted; error in /sys/conf/files

Brett Glass freebsd-prs at
Thu Nov 26 16:50:02 UTC 2009

>Number:         140904
>Category:       conf
>Synopsis:       Kernel fails to build if some unused USB Ethernet interfaces are omitted; error in /sys/conf/files
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 26 16:50:00 UTC 2009
>Originator:     Brett Glass
>Release:        8.0 -RELEASE
I encountered this bug when I was "trimming" the GENERIC kernel to omit drivers for hardware that would not be used on the 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.

A look at the file /usr/src/sys/i386/compile/KERNELNAME/Makefile showed that "usb_ethernet.o" was missing from the list of object files in the variable "OBJS". Because the Makefile wasn't properly triggering the compilation of usb_ethernet.c or including usb_ethernet.o in the list of files to be linked, the build was aborting at link time due to the unresolved references.

After a bit of research (I am admittedly unfamiliar with all of the details of the kernel build system), it appears to me that this problem is the result of the use of parentheses on line 1623 of the file /sys/conf/files. This is the only place in any of the kernel dependency metadata where parentheses are used in this way, and removing them seems to solve the problem.

I'll leave it to the committers to decide whether it is better to make the "config" utility understand parentheses or simply to make sure that none are used in the kernel dependency data.

Remove all of the USB Ethernet drivers besides "udav" from the GENERIC kernel configuration file and attempt to build a kernel.
Remove parentheses from line 1623 of /sys/conf/files.


More information about the freebsd-bugs mailing list