Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Fix devmatch config to be in-line with its current rc script #284

Open
wants to merge 3 commits into
base: trueos-master
Choose a base branch
from

Conversation

maxsteciuk
Copy link

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.

Copy link
Member

@kmoore134 kmoore134 left a 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.

@@ -9,7 +9,7 @@
#
# Generic NOMATCH event
nomatch 100 {
action "sh /etc/rc.devd devmatch start.'?'$_ '?'$_";
action "/etc/rc.d/devmatch quietstart '?'$_";
Copy link
Member

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.

Copy link
Member

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.

Copy link
Author

@maxsteciuk maxsteciuk Feb 2, 2019

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)

Copy link
Author

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

@maxsteciuk maxsteciuk force-pushed the bugfix/devmatch-config-rc-script-fix branch from cdb2174 to bfce73f Compare February 2, 2019 17:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants