1.\" 2.\" Copyright (c) 2017 Netflix, Inc. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR 14.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16.\" IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, 17.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23.\" 24.Dd August 13, 2023 25.Dt DEVMATCH 8 26.Os 27.Sh NAME 28.Nm devmatch 29.Nd print information about unattached devices 30.Sh SYNOPSIS 31.Nm 32.Op Fl a | -all 33.Op Fl d | -dump 34.Op Oo Fl h | -hints Oc Ar file 35.Op Oo Fl p | -nomatch Oc Ar event 36.Op Fl q | -quiet 37.Op Fl u | -unbound 38.Op Fl v | -verbose 39.Sh DESCRIPTION 40The 41.Nm 42utility, without any arguments, prints all the kernel modules it has 43found for all the unattached, enabled devices in the system. 44.Bl -tag -width 20m 45.It Fl a Fl -all 46Include all devices, not just the ones that are unattached. 47.It Fl d Fl -dump 48Produce a human readable dump of the 49.Pa linker.hints 50file. 51.It Fl h Fl -hints Ar file 52Use the named 53.Ar file 54instead of 55.Pa linker.hints 56guessed from the current module load path. 57.It Fl p Fl -nomatch Ar event 58Parse and use a standard NOMATCH event from 59.Xr devd 8 60for matching instead of searching the device tree. 61.It Fl q Fl -quiet 62Suppress some error messages and simply return a non-zero exit code. 63This is helpful to avoid an endless list of warnings during bootup if 64no hints are available. 65.It Fl u Fl -unbound 66Attempt to produce a list of those drivers with PNP info whose driver 67tables with that PNP info cannot be found. 68.It Fl v Fl -verbose 69Produce more verbose output. 70.El 71.Sh SEE ALSO 72.Xr rc.conf 5 , 73.Xr devinfo 8 , 74.Xr MODULE_PNP_INFO 9 75.Sh HISTORY 76.Nm 77first appeared in 78.Fx 12.0 . 79.Sh AUTHORS 80.An Warner Losh Aq Mt imp@FreeBSD.org 81.Sh BUGS 82The kernel has hints in it, but we exclude it from the list of modules 83to suggest for unmatched devices. 84We exclude it when suggesting drivers, but include it when looking for 85unbound devices or producing a full dump of 86.Pa linker.hints . 87This can be confusing. 88.Pp 89Some modules are hard links in 90.Pa /boot/kernel 91and will be reported twice. 92.Pp 93The PNP string's attributes are evaluated once per PNP entry on that 94bus rather than once. 95.Pp 96The term PNP is overloaded in 97.Fx . 98It means, generically, the identifying data the bus provides about a 99device. 100While this includes old ISA PNP identifiers, it also includes the 101logical equivalent in USB, PCI, and others. 102.Pp 103Many drivers currently lack proper PNP table decorations and need to 104be updated. 105