Make release fails on mdconfig

Ruslan Ermilov ru at
Wed Dec 5 01:26:58 PST 2007

On Tue, Dec 04, 2007 at 08:43:29AM +0100, Marco Walraven wrote:
> Hi All,
> I have been doing some release builds overhere with success, however lately the builds fail on mdconfig with the following error:
> + mdconfig -a -t vnode -f /R/stage/mfsroot/mfsroot
> mdconfig: failed to load geom_md module: No such file or directory
> *** Error code 1
> Looking at the chrooted environment I see that /boot/kernels
> is not populated whereas in old builds it is.

No, it has never been populated.

> If I install a kernel into the chrooted environment using
> 'make installkernel DESTDIR=/dir_to_chroot' and run a
> 'make rerelease' mdconfig happily accepts it and the make
> release builds successfully.  The kernel I run has support
> for mdconfig; I can use memory disks without problems.

The md(4) driver is loaded if not present in the kernel
just before switching to a chroot, by "make release":

: # Ensure md.ko is loaded if md(4) is not statically compiled into 
: # the kernel
: -mdconfig 2>/dev/null
: env -i /usr/sbin/chroot `dirname ${_MK}` /`basename ${_MK}`

> Any clue why this fails in the first place ?

It's possible that your host system is running an older version
of FreeBSD kernel with version 1 of "struct kld_file_stat",
while the release(7) procedure requires that "/usr/obj be
populated with the output of a native ``make buildworld''
compiled from sources matching the currently running kernel."

Please fix that and try again.  Following this requirement
solved a similar problem for a colleague here.

Ruslan Ermilov
ru at
FreeBSD committer

More information about the freebsd-hackers mailing list