From owner-freebsd-questions@FreeBSD.ORG Mon Sep 22 06:26:39 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D1F5216A4B3 for ; Mon, 22 Sep 2003 06:26:39 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id E087343FE1 for ; Mon, 22 Sep 2003 06:26:38 -0700 (PDT) (envelope-from freebsd-questions-local@be-well.no-ip.com) Received: from be-well.ilk.org (be-well.no-ip.com[66.30.200.37]) by comcast.net (rwcrmhc13) with ESMTP id <2003092213263701500gion7e>; Mon, 22 Sep 2003 13:26:38 +0000 Received: from be-well.ilk.org (lowellg.ne.client2.attbi.com [66.30.200.37] (may be forged)) by be-well.ilk.org (8.12.9/8.12.9) with ESMTP id h8MDQb5k044265; Mon, 22 Sep 2003 09:26:37 -0400 (EDT) (envelope-from freebsd-questions-local@be-well.no-ip.com) Received: (from lowell@localhost) by be-well.ilk.org (8.12.9/8.12.6/Submit) id h8MDQa77044262; Mon, 22 Sep 2003 09:26:36 -0400 (EDT) X-Authentication-Warning: be-well.ilk.org: lowell set sender to freebsd-questions-local@be-well.ilk.org using -f Sender: lowell@be-well.no-ip.com To: David Fleck References: <20030921083559.U1534@grond.sourballs.org> <20030921190832.51ab0169.doublef@tele-kom.ru> <20030922074442.J430@grond.sourballs.org> From: Lowell Gilbert Date: 22 Sep 2003 09:26:36 -0400 In-Reply-To: <20030922074442.J430@grond.sourballs.org> Message-ID: <441xu9eyyb.fsf@be-well.ilk.org> Lines: 28 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: FreeBSD Questions Subject: Re: What determines if kernel modules are auto-loaded? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: FreeBSD Questions List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2003 13:26:39 -0000 David Fleck 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.