xref: /freebsd/usr.sbin/kldxref/kldxref.8 (revision 02e9120893770924227138ba49df1edb3896112a)
1.\"-
2.\" Copyright (c) 2001 Boris Popov
3.\" Copyright (c) 2001 Dag-Erling 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.Dd February 25, 2023
28.Dt KLDXREF 8
29.Os
30.Sh NAME
31.Nm kldxref
32.Nd generate hints for the kernel loader
33.Sh SYNOPSIS
34.Nm
35.Op Fl Rdv
36.Op Fl f Ar hintsfile
37.Ar path ...
38.Sh DESCRIPTION
39The
40.Nm
41utility is used to generate hint files which list modules, their
42version numbers, and the files that contain them.
43These hints are used by the kernel loader to determine where to find a
44particular KLD module.
45.Pp
46A separate hint file is generated for each directory listed on the
47command line that contains modules.
48If no hint records are generated for a particular directory, no hint
49file is created, and the preexisting hint file (if there was one in
50that directory) is removed.
51.Pp
52.Nm
53ignores files with at least two "."s in the filename, such as
54.Pa foo.ko.debug
55or
56.Pa bar.ko.pkgsave .
57Note that this means that modules cannot have names such as
58.Pa foo.bar.ko .
59This limitation however, has been lived practice since the beginning of
60FreeBSD's kernel modules.
61.Pp
62The following options are available:
63.Bl -tag -width indent
64.It Fl R
65Recurse into subdirectories.
66.It Fl d
67Do not generate a hint file, but print module metadata on standard
68output.
69.It Fl f Ar hintsfile
70Specify a different name for the hints files than
71.Pa linker.hints .
72.It Fl v
73Operate in verbose mode.
74.El
75.Sh EXAMPLES
76To build hint files for both standard and add-on modules:
77.Pp
78.Dl "kldxref /boot/kernel /boot/modules"
79.Pp
80To build hint files for all installed kernels:
81.Pp
82.Dl "kldxref -R /boot"
83.Sh SEE ALSO
84.Xr kld 4 ,
85.Xr kldconfig 8 ,
86.Xr kldload 8 ,
87.Xr kldstat 8 ,
88.Xr kldunload 8
89.Sh HISTORY
90The
91.Nm
92utility first appeared in
93.Fx 5.0 .
94.Sh AUTHORS
95.An -nosplit
96The
97.Nm
98utility was implemented by
99.An Boris Popov Aq Mt bp@FreeBSD.org .
100This manual page was written by
101.An Boris Popov Aq Mt bp@FreeBSD.org
102and
103.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .
104