Date: Sat, 17 Feb 2018 07:51:17 -0700 From: Warner Losh <imp@bsdimp.com> To: Hans Petter Selasky <hselasky@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329456 - head/etc/rc.d Message-ID: <CANCZdfrq%2BtXxX6=gTdNCNV6T-9P_ixLu2OBAGoVb_Qg=9uVWsA@mail.gmail.com> In-Reply-To: <201802171332.w1HDWTBr032549@repo.freebsd.org> References: <201802171332.w1HDWTBr032549@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Feb 17, 2018 at 6:32 AM, Hans Petter Selasky <hselasky@freebsd.org> wrote: > Author: hselasky > Date: Sat Feb 17 13:32:29 2018 > New Revision: 329456 > URL: https://svnweb.freebsd.org/changeset/base/329456 > > Log: > 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. > It's more the unique part than the sort part since otherwise we try to load things a large number of times. I'd preferred if you'd talked to me about a non-urgent change like this (split / and /usr is broken already and there's a few other places that are also a problem) Warner > Sponsored by: Mellanox Technologies > > Modified: > head/etc/rc.d/devmatch > > Modified: head/etc/rc.d/devmatch > ============================================================ > ================== > --- head/etc/rc.d/devmatch Sat Feb 17 13:13:55 2018 (r329455) > +++ head/etc/rc.d/devmatch Sat Feb 17 13:32:29 2018 (r329456) > @@ -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 > } > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrq%2BtXxX6=gTdNCNV6T-9P_ixLu2OBAGoVb_Qg=9uVWsA>