aboutsummaryrefslogtreecommitdiff
path: root/etc/rc.d/devmatch
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2018-02-17 13:32:29 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2018-02-17 13:32:29 +0000
commit974a95948a897f2bbbf0b7d4476e4d06ef2ef8df (patch)
tree5fc490e3848de2cf741a3ab7c8991e784f59b4fa /etc/rc.d/devmatch
parent9a44db43eacf68468b9989cfa0071b077766de0c (diff)
downloadsrc-974a95948a897f2bbbf0b7d4476e4d06ef2ef8df.tar.gz
src-974a95948a897f2bbbf0b7d4476e4d06ef2ef8df.zip
Fix handling of "one_nomatch" shell variable to preserve its contents
appearing as a single argument passed to devmatch(8). Don't depend on "sort" utility from usr/bin which might not be available when devd is started. Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/head/; revision=329456
Diffstat (limited to 'etc/rc.d/devmatch')
-rwxr-xr-xetc/rc.d/devmatch10
1 files changed, 7 insertions, 3 deletions
diff --git a/etc/rc.d/devmatch b/etc/rc.d/devmatch
index 8f749330b531..8bcde70702b5 100755
--- a/etc/rc.d/devmatch
+++ b/etc/rc.d/devmatch
@@ -37,13 +37,17 @@ desc="Use devmatch(8) to load kernel modules"
start_cmd="${name}_start"
stop_cmd=':'
-[ -n "$2" ] && one_nomatch="-p '$2'"
+one_nomatch="$2"
devmatch_start()
{
local x
- x=$(devmatch ${one_nomatch} | sort -u)
+ if [ -n "$one_nomatch" ]; then
+ x=$(devmatch -p "${one_nomatch}")
+ else
+ x=$(devmatch)
+ fi
[ -n "$x" ] || return
@@ -53,8 +57,8 @@ devmatch_start()
# We also optimize against the false positives
# or drivers that have symbolic links that
# confuse devmatch by running it -n.
- echo "Autoloading modules: ${x}"
for m in ${x}; do
+ echo "Autoloading module: ${m}"
kldload -n ${m}
done
}