Improve devmatch driver loading

Use devctl freeze / thaw to allow us to laod multiple modules before
doing the probe/attach so they all get a bite at the apple.

Differential Revision: https://reviews.freebsd.org/D16735
This commit is contained in:
Warner Losh 2018-08-23 05:06:07 +00:00
parent 5fa2979791
commit 8769858311
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=338234

View file

@ -44,9 +44,9 @@ devmatch_start()
local x
if [ -n "$one_nomatch" ]; then
x=$(devmatch -p "${one_nomatch}")
x=$(devmatch -p "${one_nomatch}" | sort -u)
else
x=$(devmatch)
x=$(devmatch | sort -u)
fi
[ -n "$x" ] || return
@ -57,10 +57,12 @@ devmatch_start()
# We also optimize against the false positives
# or drivers that have symbolic links that
# confuse devmatch by running it -n.
devctl freeze
for m in ${x}; do
echo "Autoloading module: ${m}"
kldload -n ${m}
done
devctl thaw
}
load_rc_config $name