xref: /freebsd/usr.sbin/kldxref/kldxref.8 (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
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
53only processes files that either have no dots in their name like
54.Pa kernel
55or that end in
56.Dq .ko
57like
58.Pa foo.ko .
59.Pp
60The following options are available:
61.Bl -tag -width indent
62.It Fl R
63Recurse into subdirectories.
64.It Fl d
65Do not generate a hint file, but print module metadata on standard
66output.
67.It Fl f Ar hintsfile
68Specify a different name for the hints files than
69.Pa linker.hints .
70.It Fl v
71Operate in verbose mode.
72.El
73.Sh EXAMPLES
74To build hint files for both standard and add-on modules:
75.Pp
76.Dl "kldxref /boot/kernel /boot/modules"
77.Pp
78To build hint files for all installed kernels:
79.Pp
80.Dl "kldxref -R /boot"
81.Sh SEE ALSO
82.Xr kld 4 ,
83.Xr kldconfig 8 ,
84.Xr kldload 8 ,
85.Xr kldstat 8 ,
86.Xr kldunload 8
87.Sh HISTORY
88The
89.Nm
90utility first appeared in
91.Fx 5.0 .
92.Sh AUTHORS
93.An -nosplit
94The
95.Nm
96utility was implemented by
97.An Boris Popov Aq Mt bp@FreeBSD.org .
98This manual page was written by
99.An Boris Popov Aq Mt bp@FreeBSD.org
100and
101.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .
102