Fix devmatch config to be in-line with its current rc script #284
base: trueos-master
Are you sure you want to change the base?
Fix devmatch config to be in-line with its current rc script #284
Conversation
…eBSD ticket id=235257 for more details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the change to devmatch-openrc.conf is removed we can safely merge.
sbin/devd/devmatch-openrc.conf
Outdated
@@ -9,7 +9,7 @@ | |||
# | |||
# Generic NOMATCH event | |||
nomatch 100 { | |||
action "sh /etc/rc.devd devmatch start.'?'$_ '?'$_"; | |||
action "/etc/rc.d/devmatch quietstart '?'$_"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would break our implementation, since rc.devd handles the openrc specific devmatch stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this change should let us merge the patch to fix normal rc.d usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So when debugging I found one wrinkle: devmatch.conf is not getting triggered but devmatch-openrc.conf is and when it is triggered the action fails saying "exec: /devmatch not found". This seems like /sbin/devmatch is not in the path somehow when launched via the above subshell...
Executing 'sh /etc/rc.devd devmatch start.'?'$' at bus=0 hubaddr=3 port=4 devaddr=9 interface=0 ugen=ugen0.9 vendor=0x0451 product=0xca01 devclass=0x00 devsubclass=0x00 devproto=0x00 sernum="" release=0x0100 mode=host intclass=0x03 intsubclass=0x00 intprotocol=0x00 on uhub2' '?'$' at bus=0 hubaddr=3 port=4 devaddr=9 interface=0 ugen=ugen0.9 vendor=0x0451 product=0xca01 devclass=0x00 devsubclass=0x00 devproto=0x00 sernum="" release=0x0100 mode=host intclass=0x03 intsubclass=0x00 intprotocol=0x00 on uhub2''
exec: /devmatch: not found
update
If exec expects path to devmatch rc script then the following seems to fix "not found" error (not sure whether it looks right though...)
action "sh /etc/rc.devd /etc/rc.d/devmatch quietstart '?'$_"
Also only I was only able to get action triggered running devd -d, in foreground, no events are getting here via rc service... (currently under investigation)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the following commit bfce73f
…ut exec /devmatch not found error
cdb2174
to
bfce73f
Compare
Please see FreeBSD the following tickets for more details
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235257
project-trident/trident-core#63
I was able tested it on my machine and confirmed that when USB device was attached the devd nomatch event triggered devmatch to load respective module (when running devd in foreground)
When testing the trigger on startup I found the modules are still not autoloaded. This seems to be because USB devices are attached much earlier than devd daemon starts up. I followed up with this question on FreeBSD bugtracker.