xref: /freebsd/usr.sbin/kldxref/kldxref.8 (revision 9f23cbd6cae82fd77edfad7173432fa8dccd0a95)
1.\"-
2.\" Copyright (c) 2001 Boris Popov
3.\" Copyright (c) 2001 Dag-Erling Coïdan Smørgrav
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" $FreeBSD$
28.\"
29.Dd February 25, 2023
30.Dt KLDXREF 8
31.Os
32.Sh NAME
33.Nm kldxref
34.Nd generate hints for the kernel loader
35.Sh SYNOPSIS
36.Nm
37.Op Fl Rdv
38.Op Fl f Ar hintsfile
39.Ar path ...
40.Sh DESCRIPTION
41The
42.Nm
43utility is used to generate hint files which list modules, their
44version numbers, and the files that contain them.
45These hints are used by the kernel loader to determine where to find a
46particular KLD module.
47.Pp
48A separate hint file is generated for each directory listed on the
49command line that contains modules.
50If no hint records are generated for a particular directory, no hint
51file is created, and the preexisting hint file (if there was one in
52that directory) is removed.
53.Pp
54.Nm
55ignores files with at least two "."s in the filename, such as
56.Pa foo.ko.debug
57or
58.Pa bar.ko.pkgsave .
59Note that this means that modules cannot have names such as
60.Pa foo.bar.ko .
61This limitation however, has been lived practice since the beginning of
62FreeBSD's kernel modules.
63.Pp
64The following options are available:
65.Bl -tag -width indent
66.It Fl R
67Recurse into subdirectories.
68.It Fl d
69Do not generate a hint file, but print module metadata on standard
70output.
71.It Fl f Ar hintsfile
72Specify a different name for the hints files than
73.Pa linker.hints .
74.It Fl v
75Operate in verbose mode.
76.El
77.Sh EXAMPLES
78To build hint files for both standard and add-on modules:
79.Pp
80.Dl "kldxref /boot/kernel /boot/modules"
81.Pp
82To build hint files for all installed kernels:
83.Pp
84.Dl "kldxref -R /boot"
85.Sh SEE ALSO
86.Xr kld 4 ,
87.Xr kldconfig 8 ,
88.Xr kldload 8 ,
89.Xr kldstat 8 ,
90.Xr kldunload 8
91.Sh HISTORY
92The
93.Nm
94utility first appeared in
95.Fx 5.0 .
96.Sh AUTHORS
97.An -nosplit
98The
99.Nm
100utility was implemented by
101.An Boris Popov Aq Mt bp@FreeBSD.org .
102This manual page was written by
103.An Boris Popov Aq Mt bp@FreeBSD.org
104and
105.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .
106