From owner-svn-src-head@FreeBSD.ORG Sun Jul 10 23:47:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 973EB106566B; Sun, 10 Jul 2011 23:47:03 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 872F28FC0C; Sun, 10 Jul 2011 23:47:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6ANl3bL066323; Sun, 10 Jul 2011 23:47:03 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6ANl3qK066321; Sun, 10 Jul 2011 23:47:03 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201107102347.p6ANl3qK066321@svn.freebsd.org> From: Doug Barton Date: Sun, 10 Jul 2011 23:47:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223917 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jul 2011 23:47:03 -0000 Author: dougb Date: Sun Jul 10 23:47:03 2011 New Revision: 223917 URL: http://svn.freebsd.org/changeset/base/223917 Log: Make sure we load kernel modules from the same path as the running kernel Modified: head/etc/rc.d/kld Modified: head/etc/rc.d/kld ============================================================================== --- head/etc/rc.d/kld Sun Jul 10 22:09:53 2011 (r223916) +++ head/etc/rc.d/kld Sun Jul 10 23:47:03 2011 (r223917) @@ -41,11 +41,24 @@ kld_start() { [ -n "$kld_list" ] || return - local _kld + local _kernel_path _module_path _kld _path + + _kernel_path=`$SYSCTL_N kern.bootfile` + _kernel_path="${_kernel_path%/*}" + + _module_path=`$SYSCTL_N kern.module_path` + _module_path="${_module_path#*\;}" + _module_path="$_kernel_path `ltr $_module_path \; ' '`" echo 'Loading kernel modules:' for _kld in $kld_list ; do - load_kld -e ${_kld}.ko $_kld + for _path in $_module_path ; do + if [ -x "${_path}/${_kld}.ko" ]; then + load_kld -e ${_kld}.ko ${_path}/${_kld}.ko + continue 2 + fi + done + warn "${_kld}.ko not found in $_module_path" done }