Date: 22 Sep 2003 09:26:36 -0400 From: Lowell Gilbert <freebsd-questions-local@be-well.no-ip.com> To: David Fleck <david.fleck@mchsi.com> Cc: FreeBSD Questions <freebsd-questions@freebsd.org> Subject: Re: What determines if kernel modules are auto-loaded? Message-ID: <441xu9eyyb.fsf@be-well.ilk.org> In-Reply-To: <20030922074442.J430@grond.sourballs.org> References: <20030921083559.U1534@grond.sourballs.org> <20030921190832.51ab0169.doublef@tele-kom.ru> <20030922074442.J430@grond.sourballs.org>
next in thread | previous in thread | raw e-mail | index | archive | help
David Fleck <david.fleck@mchsi.com> writes: > Why, for instance, does my (4.6.2-RELEASE-p20) system have a nfs.ko kernel > module, and a line in /boot/defaults/loader.conf to enable this module, > but (apparently) no way to *use* the module? If I compile a kernel with > 'options NFS' uncommented in the kernel config file, the nfs module gets > built into the kernel, and loading the module is pointless - however, if I > comment out 'options NFS', the kernel can't compile because of missing > symbols. So I have a chunk of code that gets built by the makefile as a > module, but can't be used as a module? I find this all very unintuitive. Quite simply, it *can* be used as a module. Your problems trying to do that are probably pilot error; at a guess, you forgot to remove NFS_ROOT from the kernel configuration when you removed NFS. > What seems to be happening during the kernel compile process is that a > certain number of modules are always compiled, regardless of config file > settings - the settings only determine if a given chunk of code makes it > into the kernel itself. If the module is compiled into a .ko file, and if > the code isn't present in the kernel, then it can be loaded by kldload. Is > this correct? That's exactly right. Even if the functionality is already in the kernel, the module is built as well. There are make.conf(5) settings to change (by hand) which modules do/don't get built, but most people find it easier to just not worry about it and let everything get built.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?441xu9eyyb.fsf>