From owner-freebsd-current@FreeBSD.ORG Sat Jun 11 22:17:48 2011 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id DF5F01065670 for ; Sat, 11 Jun 2011 22:17:48 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-5.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 6711814E28B for ; Sat, 11 Jun 2011 22:17:47 +0000 (UTC) Message-ID: <4DF3E98B.40108@FreeBSD.org> Date: Sat, 11 Jun 2011 15:17:47 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 MIME-Version: 1.0 To: freebsd-current@FreeBSD.org X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------090109060102060608080400" Cc: Subject: rc.d script to load kernel modules X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2011 22:17:49 -0000 This is a multi-part message in MIME format. --------------090109060102060608080400 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Howdy, Per discussion on -arch and the svn list about improving boot time and stripping down the kernel to just that-which-cannot-be-modularized I created the attached script to kldload modules that don't need to be in loader.conf. It cut quite a bit of time off my boot, so hopefully it will be useful to others as well. To use it just put everything that is being _load'ed in loader.conf into kld_list in rc.conf[.local]. For example, mine has: kld_list='umass coretemp ichwd linux nvidia if_wpi' If there is agreement that this is a good direction to go I'll be happy to commit this along with the relevant /etc/defaults/rc.conf and rc.conf.5 changes. hth, Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------090109060102060608080400 Content-Type: text/plain; name="kld" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kld" #!/bin/sh # $FreeBSD$ # # PROVIDE: kld # REQUIRE: FILESYSTEMS # KEYWORD: nojail # BEFORE: var . /etc/rc.subr name="kld" start_cmd="${name}_start" stop_cmd=':' kld_start() { [ -n "$kld_list" ] || return local _kld echo 'Loading kernel modules:' for _kld in $kld_list ; do load_kld -e ${_kld}.ko $_kld done } load_rc_config $name run_rc_command "$1" --------------090109060102060608080400--