From owner-freebsd-hackers Wed Nov 6 2:44:23 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6792B37B401 for ; Wed, 6 Nov 2002 02:44:22 -0800 (PST) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 290FF43E88 for ; Wed, 6 Nov 2002 02:44:22 -0800 (PST) (envelope-from mux@freebsd.org) Received: by elvis.mu.org (Postfix, from userid 1920) id E3DC8AE2EF; Wed, 6 Nov 2002 02:44:21 -0800 (PST) Date: Wed, 6 Nov 2002 02:44:21 -0800 From: Maxime Henrion To: "M. Warner Losh" Cc: chuck_tuffli@agilent.com, freebsd-hackers@FreeBSD.ORG Subject: Re: load time module parameters? Message-ID: <20021106104421.GK26605@elvis.mu.org> References: <20021105222958.GH17013@cre85086tuf.rose.agilent.com> <20021105.222147.10576668.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021105.222147.10576668.imp@bsdimp.com> User-Agent: Mutt/1.4i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG M. Warner Losh wrote: > In message: <20021105222958.GH17013@cre85086tuf.rose.agilent.com> > Chuck Tuffli writes: > : I'm a newbie to FreeBSD and am wondering if there is a way to pass > : loadable kernel modules parameters. Under Linux, if a module had > : configurable parameters "a" and "b", you can do something like > : > : insmod module.o parameters="a:10 b:5" > : > : I noticed that some of the drivers grabed information from the > : "environment" using getenv_int(), but I couldn't seem to get this to > : work. Thanks for any thoughts. > > You can generally do this with hints and/or kernel environment > variables. However, you can't easily edit these things once you > boot. With kenv(1) you can modify kernel environment variables, which hold the tunables. Previously, you could only set those at boot time. Now you can have load time module parameters, and you can do things like unload a module, change the parameter, reload it and it will take effect immediately. This is really useful for things which need to be gathered by the module at load time, because the module can't use a sysctl for this if it's at load time. I have patches which make the IPFIREWALL_DEFAULT_TO_ACCEPT setting dynamic with kernel environment variables. So people can install FreeBSD, use the already compiled ipfw module and still change this setting. Cheers, Maxime To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message