Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jul 2021 21:27:26 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: b29ebb9c65b3 - main - devmatch: Be tolerant of .ko being present.
Message-ID:  <202107082127.168LRQVb081654@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=b29ebb9c65b350e78aedfc790bfcaf9717059b70

commit b29ebb9c65b350e78aedfc790bfcaf9717059b70
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2021-07-08 19:44:21 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2021-07-08 21:22:22 +0000

    devmatch: Be tolerant of .ko being present.
    
    We document that we did not need .ko on the module names in
    devmatch_blocklist, but we really needed them. Keep the documentation
    the same, but strip the .ko when we need to use the names so you can
    specify either.
    
    PR:                     256240
    MFC After:              2 weeks
    Sponsored by:           Netflix
---
 libexec/rc/rc.d/devmatch | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/libexec/rc/rc.d/devmatch b/libexec/rc/rc.d/devmatch
index dd61307a4e0a..f7f677b968e7 100755
--- a/libexec/rc/rc.d/devmatch
+++ b/libexec/rc/rc.d/devmatch
@@ -52,18 +52,23 @@ devmatch_start()
 
 	[ -n "$list" ] || return
 
-	# While kldload can accept multiple modules
-	# on the line at once, we loop here in case
-	# there's some weird error with one of them.
-	# We also optimize against the false positives
-	# or drivers that have symbolic links that
-	# confuse devmatch by running it -n.
-	# Finally, we filter out all items in the
-	# devmatch_blocklist.
+	# While kldload can accept multiple modules on the line at once, we loop
+	# here in case there's some weird error with one of them.  We also
+	# optimize against the false positives or drivers that have symbolic
+	# links that confuse devmatch by running it -n.  Finally, we filter out
+	# all items in the devmatch_blocklist.
+	#
+	# We strip all the .ko suffixes off so that one may specify modules
+	# with or without .ko. Prior version documented it was without, while
+	# the code required it, so accept both now. devmatch produces module
+	# names with .ko
+
 	devctl freeze
-	x=$(echo ${devmatch_blocklist:-${devmatch_blacklist}} | tr ' ' '#')
+	x=$(echo '#'${devmatch_blocklist:-${devmatch_blacklist}}'#' | \
+		sed -e "s/ /#/g;s/\.ko#/#/g")
 	for m in ${list}; do
-		case "#${x}#" in
+		m="${m%.ko}"
+		case "${x}" in
 		*"#${m}#"*) continue ;;
 		esac
 		echo "Autoloading module: ${m}"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107082127.168LRQVb081654>