svn commit: r329458 - head/sbin/devmatch

Hans Petter Selasky hps at selasky.org
Sat Feb 17 15:19:58 UTC 2018


On 02/17/18 16:07, Warner Losh wrote:
> It would be more helpful if you could turn on devd's logging (by adding
> !devd
> *.>=info                                       /var/log/devd.log
> to /etc/syslog.conf, restarting syslog and then giving me the exact
> scenario that's failing so I can add it to a test suite I'm writing. The
> data will be in /var/log/devd.log. I can't possibly test all the crazy USB
> scenarios with the hardware I have (there's too many of them), but I can
> test it in simulation and make sure we're good.

It wasn't a problem with devd. It was a problem with /etc/rc.d/devmatch .



In your initial devmatch rc.d, look at this:

one_nomatch="-p '$2'"
devmatch ${one_nomatch}


Try this (your initial devmatch):

#!/bin/sh
test='? at bus=0 hubaddr=1 port=6 devaddr=8 interface=1 ugen=ugen0.8 
vendor=0x8087 product=0x0a2b devclass=0xe0 devsubclass=0x01 
devproto=0x01 release=0x0001 mode=host intclass=0xe0 intsubclass=0x01 
intprotocol=0x01 on uhub0'

one_nomatch="-p '$test'"
devmatch ${one_nomatch}


I fixed it to this, which works:

#!/bin/sh
test='? at bus=0 hubaddr=1 port=6 devaddr=8 interface=1 ugen=ugen0.8 
vendor=0x8087 product=0x0a2b devclass=0xe0 devsubclass=0x01 
devproto=0x01 release=0x0001 mode=host intclass=0xe0 intsubclass=0x01 
intprotocol=0x01 on uhub0'

one_nomatch="$test"
devmatch -p "${one_nomatch}"




Because the $2 variable already contains ''s from devd, the variable 
expansion then makes devmatch receive the whole devd generated variable 
list like a separate arguments.

Which leads me to believe you are not using /bin/sh or you tested 
something different than was committed ??

--HPS



More information about the svn-src-head mailing list