Date: Sat, 17 Feb 2018 16:17:00 +0100 From: Hans Petter Selasky <hps@selasky.org> To: Warner Losh <imp@bsdimp.com> Cc: src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329458 - head/sbin/devmatch Message-ID: <fafd954b-7479-bde8-f43b-4e15e0c868ef@selasky.org> In-Reply-To: <CANCZdfphV7XgZ14HPPDhtiFbmNPjCS4DVSdeZf7n-58XTm_NHw@mail.gmail.com> References: <201802171434.w1HEYl8I063603@repo.freebsd.org> <CANCZdfrevbHxoRmV4HyjR9j%2B4%2BHbCU8H-aUhuhHjaySA=hwrsA@mail.gmail.com> <5b49c102-ad07-cfdb-2e45-e27cee99ee81@selasky.org> <CANCZdfphV7XgZ14HPPDhtiFbmNPjCS4DVSdeZf7n-58XTm_NHw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?fafd954b-7479-bde8-f43b-4e15e0c868ef>