From owner-svn-src-all@freebsd.org Wed Apr 10 07:51:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D76EA157B884; Wed, 10 Apr 2019 07:51:15 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AC36944FF; Wed, 10 Apr 2019 07:51:15 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53A281F8CB; Wed, 10 Apr 2019 07:51:15 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3A7pFdo045002; Wed, 10 Apr 2019 07:51:15 GMT (envelope-from crees@FreeBSD.org) Received: (from crees@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3A7pDo8044989; Wed, 10 Apr 2019 07:51:13 GMT (envelope-from crees@FreeBSD.org) Message-Id: <201904100751.x3A7pDo8044989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: crees set sender to crees@FreeBSD.org using -f From: Chris Rees Date: Wed, 10 Apr 2019 07:51:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346072 - in head: libexec/rc libexec/rc/rc.d share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: crees X-SVN-Commit-Paths: in head: libexec/rc libexec/rc/rc.d share/man/man5 X-SVN-Commit-Revision: 346072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7AC36944FF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Apr 2019 07:51:16 -0000 Author: crees (doc,ports committer) Date: Wed Apr 10 07:51:13 2019 New Revision: 346072 URL: https://svnweb.freebsd.org/changeset/base/346072 Log: Revert r346017 pending compiled-in zfs fix PR: 237172 Approved by: jilles Differential Revision: https://reviews.freebsd.org/D18670 Modified: head/libexec/rc/rc.d/abi head/libexec/rc/rc.d/bthidd head/libexec/rc/rc.d/cfumass head/libexec/rc/rc.d/kld head/libexec/rc/rc.d/mdconfig head/libexec/rc/rc.d/mdconfig2 head/libexec/rc/rc.d/mountcritremote head/libexec/rc/rc.d/syscons head/libexec/rc/rc.subr head/share/man/man5/rc.conf.5 Modified: head/libexec/rc/rc.d/abi ============================================================================== --- head/libexec/rc/rc.d/abi Wed Apr 10 06:23:15 2019 (r346071) +++ head/libexec/rc/rc.d/abi Wed Apr 10 07:51:13 2019 (r346072) @@ -27,10 +27,10 @@ linux_start() local _tmpdir echo -n ' linux' - load_kld linux + load_kld -e 'linux(aout|elf)' linux case `sysctl -n hw.machine_arch` in amd64) - load_kld linux64 + load_kld -e 'linux64elf' linux64 ;; esac if [ -x /compat/linux/sbin/ldconfigDisabled ]; then Modified: head/libexec/rc/rc.d/bthidd ============================================================================== --- head/libexec/rc/rc.d/bthidd Wed Apr 10 06:23:15 2019 (r346071) +++ head/libexec/rc/rc.d/bthidd Wed Apr 10 07:51:13 2019 (r346072) @@ -34,11 +34,11 @@ evdev_enabled() bthidd_prestart() { if evdev_enabled; then - load_kld uinput + load_kld -m uinput uinput fi - load_kld kbdmux - load_kld vkbd - load_kld ng_btsocket + load_kld -m kbdmux kbdmux + load_kld -m vkbd vkbd + load_kld -m ng_btsocket ng_btsocket return 0 } Modified: head/libexec/rc/rc.d/cfumass ============================================================================== --- head/libexec/rc/rc.d/cfumass Wed Apr 10 06:23:15 2019 (r346071) +++ head/libexec/rc/rc.d/cfumass Wed Apr 10 07:51:13 2019 (r346072) @@ -75,7 +75,7 @@ cfumass_start() return "${err}" fi - load_kld cfumass + load_kld -e cfumass cfumass # If the template is already switched to Mass Storage, then reset # it to -1 to force the host to reenumerate it; otherwise it might Modified: head/libexec/rc/rc.d/kld ============================================================================== --- head/libexec/rc/rc.d/kld Wed Apr 10 06:23:15 2019 (r346071) +++ head/libexec/rc/rc.d/kld Wed Apr 10 07:51:13 2019 (r346072) @@ -46,7 +46,7 @@ kld_start() echo 'Loading kernel modules:' for _kld in $kld_list ; do - load_kld $_kld + load_kld -e ${_kld}.ko $_kld done } Modified: head/libexec/rc/rc.d/mdconfig ============================================================================== --- head/libexec/rc/rc.d/mdconfig Wed Apr 10 06:23:15 2019 (r346071) +++ head/libexec/rc/rc.d/mdconfig Wed Apr 10 07:51:13 2019 (r346072) @@ -114,7 +114,7 @@ mdconfig_start() continue fi if [ "${_file}" != "${_file%.uzip}" ]; then - load_kld geom_uzip || return 3 + load_kld -m g_uzip geom_uzip || return 3 # sleep a bit to allow creation of /dev/mdX.uzip sleep 2 fi Modified: head/libexec/rc/rc.d/mdconfig2 ============================================================================== --- head/libexec/rc/rc.d/mdconfig2 Wed Apr 10 06:23:15 2019 (r346071) +++ head/libexec/rc/rc.d/mdconfig2 Wed Apr 10 07:51:13 2019 (r346072) @@ -123,7 +123,7 @@ mdconfig2_start() # been created. if [ "${_type}" = "vnode" -a "${_fs}" != "/" ]; then if [ "${_file}" != "${_file%.uzip}" ]; then - load_kld geom_uzip || return 3 + load_kld -m g_uzip geom_uzip || return 3 fi if is_readonly ${_fs}; then warn "${_fs} is mounted read-only, skipping ${_md}." Modified: head/libexec/rc/rc.d/mountcritremote ============================================================================== --- head/libexec/rc/rc.d/mountcritremote Wed Apr 10 06:23:15 2019 (r346071) +++ head/libexec/rc/rc.d/mountcritremote Wed Apr 10 07:51:13 2019 (r346072) @@ -27,7 +27,7 @@ mountcritremote_precmd() case "`mount -d -a -t nfs 2> /dev/null`" in *mount_nfs*) # Handle absent nfs client support - load_kld nfscl || return 1 + load_kld -m nfs nfscl || return 1 ;; esac return 0 Modified: head/libexec/rc/rc.d/syscons ============================================================================== --- head/libexec/rc/rc.d/syscons Wed Apr 10 06:23:15 2019 (r346071) +++ head/libexec/rc/rc.d/syscons Wed Apr 10 07:51:13 2019 (r346072) @@ -346,7 +346,7 @@ syscons_start() for i in `kldstat | awk '$5 ~ "_saver\.ko$" { print $5 }'`; do kldunload ${i} done - load_kld ${saver}_saver + load_kld -e _saver ${saver}_saver ;; esac Modified: head/libexec/rc/rc.subr ============================================================================== --- head/libexec/rc/rc.subr Wed Apr 10 06:23:15 2019 (r346071) +++ head/libexec/rc/rc.subr Wed Apr 10 07:51:13 2019 (r346072) @@ -1853,29 +1853,48 @@ mount_md() } # Code common to scripts that need to load a kernel module -# if it isn't in the kernel yet. Syntax: -# load_kld file +# if it isn't in the kernel yet. Syntax: +# load_kld [-e regex] [-m module] file +# where -e or -m chooses the way to check if the module +# is already loaded: +# regex is egrep'd in the output from `kldstat -v', +# module is passed to `kldstat -m'. +# The default way is as though `-m file' were specified. load_kld() { - local _opt + local _loaded _mod _opt _re - # Silently ignore legacy options; they are unnecessary while getopts "e:m:" _opt; do case "$_opt" in - e) ;; - m) ;; - *) err 3 'USAGE: load_kld file' ;; + e) _re="$OPTARG" ;; + m) _mod="$OPTARG" ;; + *) err 3 'USAGE: load_kld [-e regex] [-m module] file' ;; esac done shift $(($OPTIND - 1)) if [ $# -ne 1 ]; then - err 3 'USAGE: load_kld file' + err 3 'USAGE: load_kld [-e regex] [-m module] file' fi - if ! kldload -n "$1"; then - warn "Unable to load kernel module $1" - return 1 + _mod=${_mod:-$1} + _loaded=false + if [ -n "$_re" ]; then + if kldstat -v | egrep -q -e "$_re"; then + _loaded=true + fi else - info "$1 kernel module loaded." + if kldstat -q -m "$_mod"; then + _loaded=true + fi + fi + if ! $_loaded; then + if ! kldload "$1"; then + warn "Unable to load kernel module $1" + return 1 + else + info "$1 kernel module loaded." + fi + else + debug "load_kld: $1 kernel module already loaded." fi return 0 } Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Wed Apr 10 06:23:15 2019 (r346071) +++ head/share/man/man5/rc.conf.5 Wed Apr 10 07:51:13 2019 (r346072) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 7, 2019 +.Dd March 21, 2019 .Dt RC.CONF 5 .Os .Sh NAME @@ -249,7 +249,9 @@ Default .It Va kld_list .Pq Vt str A whitespace-separated list of kernel modules to load right after -the local disks are mounted, with optional path. +the local disks are mounted, without any +.Pa .ko +extension or path. Loading modules at this point in the boot process is much faster than doing it via .Pa /boot/loader.conf