From nobody Sun Nov 21 15:59:01 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 855AA18967E0; Sun, 21 Nov 2021 15:59:02 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hxw7V0kFWz3hnK; Sun, 21 Nov 2021 15:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D579711E4D; Sun, 21 Nov 2021 15:59:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ALFx1p7081654; Sun, 21 Nov 2021 15:59:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ALFx1qV081653; Sun, 21 Nov 2021 15:59:01 GMT (envelope-from git) Date: Sun, 21 Nov 2021 15:59:01 GMT Message-Id: <202111211559.1ALFx1qV081653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a8935083b518 - main - devmatch: Allow devmatch_blocklist to be set in kenv too List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a8935083b5181b0a56d26cad7191ef138228befd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a8935083b5181b0a56d26cad7191ef138228befd commit a8935083b5181b0a56d26cad7191ef138228befd Author: Warner Losh AuthorDate: 2021-11-21 15:50:51 +0000 Commit: Warner Losh CommitDate: 2021-11-21 15:54:45 +0000 devmatch: Allow devmatch_blocklist to be set in kenv too Add in all the variables set in the kenv variable devmatch_blocklist too. This allows blocking autoloading from the boot loader. Sponsored by: Netflix Reviewed by: 0mp Differential Revision: https://reviews.freebsd.org/D32171 --- libexec/rc/rc.d/devmatch | 2 +- sbin/devmatch/devmatch.8 | 3 ++- share/man/man5/rc.conf.5 | 8 +++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/libexec/rc/rc.d/devmatch b/libexec/rc/rc.d/devmatch index f5b8e8e51071..f7925321eebe 100755 --- a/libexec/rc/rc.d/devmatch +++ b/libexec/rc/rc.d/devmatch @@ -64,7 +64,7 @@ devmatch_start() # names with .ko devctl freeze - x=$(echo '#'${devmatch_blocklist:-${devmatch_blacklist}}'#' | \ + x=$(echo "#${devmatch_blocklist:-${devmatch_blacklist}}#$(kenv -q devmatch_blocklist)#" | \ sed -e "s/ /#/g;s/\.ko#/#/g") for m in ${list}; do m="${m%.ko}" diff --git a/sbin/devmatch/devmatch.8 b/sbin/devmatch/devmatch.8 index 914dacf58fdc..11cf844bef9f 100644 --- a/sbin/devmatch/devmatch.8 +++ b/sbin/devmatch/devmatch.8 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 12, 2020 +.Dd November 21, 2021 .Dt DEVMATCH 8 .Os .Sh NAME @@ -67,6 +67,7 @@ tables with that PNP info can not be found. Produce more verbose output. .El .Sh SEE ALSO +.Xr rc.conf 5 , .Xr devinfo 8 , .Xr MODULE_PNP_INFO 9 .Sh HISTORY diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index c680ed94575a..a22f267c13b9 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 18, 2021 +.Dd November 21, 2021 .Dt RC.CONF 5 .Os .Sh NAME @@ -261,6 +261,12 @@ disable auto-loading of kernel modules with .Pq Vt str A whitespace-separated list of kernel modules to be ignored by .Xr devmatch 8 . +In addition, the +.Xr kenv 1 +.Va devmatch_blocklist +is appended to this variable to allow disabling of +.Xr devmatch 8 +loaded modules from the boot loader. .It Va devmatch_blacklist .Pq Vt str This variable is deprecated.