xref: /freebsd/sbin/devmatch/devmatch.8 (revision 9768746b)
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.\" $FreeBSD$
25.\"
26.Dd November 3, 2022
27.Dt DEVMATCH 8
28.Os
29.Sh NAME
30.Nm devmatch
31.Nd print information about unattached devices
32.Sh SYNOPSIS
33.Nm
34.Op Fl a | -all
35.Op Fl d | -dump
36.Op Oo Fl h | -hints Oc Ar file
37.Op Oo Fl p | -nomatch Oc Ar event
38.Op Fl u | -unbound
39.Op Fl v | -verbose
40.Sh DESCRIPTION
41The
42.Nm
43utility, without any arguments, prints all the kernel modules it has
44found for all the unattached, enabled devices in the system.
45.Bl -tag -width 20m
46.It Fl a Fl -all
47Include all devices, not just the ones that are unattached.
48.It Fl d Fl -dump
49Produce a human readable dump of the
50.Pa linker.hints
51file.
52.It Fl h Fl -hints Ar file
53Use the named
54.Ar file
55instead of
56.Pa linker.hints
57guessed from the current module load path.
58.It Fl p Fl -nomatch Ar event
59Parse and use a standard NOMATCH event from
60.Xr devd 8
61for matching instead of searching the device tree.
62.It Fl u Fl -unbound
63Attempt to produce a list of those drivers with PNP info whose driver
64tables with that PNP info cannot be found.
65.It Fl v Fl -verbose
66Produce more verbose output.
67.El
68.Sh SEE ALSO
69.Xr rc.conf 5 ,
70.Xr devinfo 8 ,
71.Xr MODULE_PNP_INFO 9
72.Sh HISTORY
73.Nm
74first appeared in
75.Fx 12.0 .
76.Sh AUTHORS
77.An Warner Losh Aq Mt imp@FreeBSD.org
78.Sh BUGS
79The kernel has hints in it, but we exclude it from the list of modules
80to suggest for unmatched devices.
81We exclude it when suggesting drivers, but include it when looking for
82unbound devices or producing a full dump of
83.Pa linker.hints .
84This can be confusing.
85.Pp
86Some modules are hard links in
87.Pa /boot/kernel
88and will be reported twice.
89.Pp
90The PNP string's attributes are evaluated once per PNP entry on that
91bus rather than once.
92.Pp
93The term PNP is overloaded in
94.Fx .
95It means, generically, the identifying data the bus provides about a
96device.
97While this include old ISA PNP identifiers, it also includes the
98logical equivalent in USB, PCI, and others.
99.Pp
100Many drivers currently lack proper PNP table decorations and need to
101be updated.
102