diff --git a/libexec/rc/rc.d/devmatch b/libexec/rc/rc.d/devmatch --- a/libexec/rc/rc.d/devmatch +++ b/libexec/rc/rc.d/devmatch @@ -46,6 +46,7 @@ if [ -n "$one_nomatch" ]; then list=$(devmatch -p "${one_nomatch}" | sort -u) else + sysctl hw.bus.devctl_nomatch_enabled=1 list=$(devmatch | sort -u) fi diff --git a/sys/kern/kern_devctl.c b/sys/kern/kern_devctl.c --- a/sys/kern/kern_devctl.c +++ b/sys/kern/kern_devctl.c @@ -89,6 +89,9 @@ static int devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN; SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_queue, CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_queue, "I", "devctl queue length"); +static bool nomatch_enabled = 0; +SYSCTL_BOOL(_hw_bus, OID_AUTO, devctl_nomatch_enabled, CTLFLAG_RWTUN, + &nomatch_enabled, 0, "enable nomatch events"); static void devctl_attach_handler(void *arg __unused, device_t dev); static void devctl_detach_handler(void *arg __unused, device_t dev, @@ -208,7 +211,8 @@ static void devctl_nomatch_handler(void *arg __unused, device_t dev) { - devaddq("?", "", dev); + if (nomatch_enabled) + devaddq("?", "", dev); } static int