xref: /freebsd/sbin/kldconfig/kldconfig.8 (revision cf0fd1f84a4313d78e40fbd66f23c201f3ff69ab)
148c8fe68SPeter Pentchev.\"
248c8fe68SPeter Pentchev.\" Copyright (c) 2001 Peter Pentchev
348c8fe68SPeter Pentchev.\" All rights reserved.
448c8fe68SPeter Pentchev.\"
548c8fe68SPeter Pentchev.\" Redistribution and use in source and binary forms, with or without
648c8fe68SPeter Pentchev.\" modification, are permitted provided that the following conditions
748c8fe68SPeter Pentchev.\" are met:
848c8fe68SPeter Pentchev.\" 1. Redistributions of source code must retain the above copyright
948c8fe68SPeter Pentchev.\"    notice, this list of conditions and the following disclaimer.
1048c8fe68SPeter Pentchev.\" 2. Redistributions in binary form must reproduce the above copyright
1148c8fe68SPeter Pentchev.\"    notice, this list of conditions and the following disclaimer in the
1248c8fe68SPeter Pentchev.\"    documentation and/or other materials provided with the distribution.
1348c8fe68SPeter Pentchev.\"
1448c8fe68SPeter Pentchev.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1548c8fe68SPeter Pentchev.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1648c8fe68SPeter Pentchev.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1748c8fe68SPeter Pentchev.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1848c8fe68SPeter Pentchev.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1948c8fe68SPeter Pentchev.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2048c8fe68SPeter Pentchev.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2148c8fe68SPeter Pentchev.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2248c8fe68SPeter Pentchev.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2348c8fe68SPeter Pentchev.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2448c8fe68SPeter Pentchev.\" SUCH DAMAGE.
2548c8fe68SPeter Pentchev.\"
2648c8fe68SPeter Pentchev.\" $FreeBSD$
2748c8fe68SPeter Pentchev.\"
28*cf0fd1f8SFernando Apesteguía.Dd September 29, 2020
2948c8fe68SPeter Pentchev.Dt KLDCONFIG 8
3048c8fe68SPeter Pentchev.Os
3148c8fe68SPeter Pentchev.Sh NAME
3248c8fe68SPeter Pentchev.Nm kldconfig
3348c8fe68SPeter Pentchev.Nd display or modify the kernel module search path
3448c8fe68SPeter Pentchev.Sh SYNOPSIS
3548c8fe68SPeter Pentchev.Nm
3648c8fe68SPeter Pentchev.Op Fl dfimnUv
378d646af5SRuslan Ermilov.Op Fl S Ar sysctlname
3848c8fe68SPeter Pentchev.Op Ar path ...
3948c8fe68SPeter Pentchev.Nm
4048c8fe68SPeter Pentchev.Fl r
4148c8fe68SPeter Pentchev.Sh DESCRIPTION
42e1205e80SPhilippe CharnierThe
4348c8fe68SPeter Pentchev.Nm
44e1205e80SPhilippe Charnierutility
4548c8fe68SPeter Pentchevdisplays or modifies the search path used by the kernel when loading modules
4648c8fe68SPeter Pentchevusing the
4748c8fe68SPeter Pentchev.Xr kldload 8
4848c8fe68SPeter Pentchevutility or the
4948c8fe68SPeter Pentchev.Xr kldload 2
5048c8fe68SPeter Pentchevsyscall.
5148c8fe68SPeter Pentchev.Pp
5248c8fe68SPeter PentchevThe following options are available:
5348c8fe68SPeter Pentchev.Bl -tag -width indent
5448c8fe68SPeter Pentchev.It Fl d
5548c8fe68SPeter PentchevRemove the specified paths from the module search path.
5648c8fe68SPeter Pentchev.It Fl f
57*cf0fd1f8SFernando ApesteguíaDo not fail if a path specified for adding is already present in the search
58*cf0fd1f8SFernando Apesteguíapath, or if a path specified for removing is not present in the search path.
5948c8fe68SPeter PentchevThis may be useful in startup/shutdown scripts for adding a path to
6048c8fe68SPeter Pentcheva file system which is still not mounted, or in shutdown scripts for
6148c8fe68SPeter Pentchevunconditionally removing a path that may have been added during startup.
6248c8fe68SPeter Pentchev.It Fl i
6348c8fe68SPeter PentchevAdd the specified paths to the beginning of the search path, not to the end.
6448c8fe68SPeter PentchevThis option can only be used when adding paths.
6548c8fe68SPeter Pentchev.It Fl m
6648c8fe68SPeter PentchevInstead of replacing the module search path with the set of paths
6748c8fe68SPeter Pentchevspecified,
6848c8fe68SPeter Pentchev.Dq merge
6948c8fe68SPeter Pentchevin the new entries.
7048c8fe68SPeter Pentchev.It Fl n
7148c8fe68SPeter PentchevDo not actually change the module search path.
7248c8fe68SPeter Pentchev.It Fl r
7348c8fe68SPeter PentchevDisplay the current search path.
7448c8fe68SPeter PentchevThis option cannot be used if any paths are also specified.
758d646af5SRuslan Ermilov.It Fl S Ar sysctlname
7648c8fe68SPeter PentchevSpecify the sysctl name to use instead of the default
7748c8fe68SPeter Pentchev.Va kern.module_path .
7848c8fe68SPeter Pentchev.It Fl U
7948c8fe68SPeter Pentchev.Dq Unique-ify
8048c8fe68SPeter Pentchevthe current search path - if any of the directories is repeated one
8148c8fe68SPeter Pentchevor more times, only the first occurrence remains.
8248c8fe68SPeter PentchevThis option implies
8348c8fe68SPeter Pentchev.Fl m .
8448c8fe68SPeter Pentchev.It Fl v
8548c8fe68SPeter PentchevVerbose output: display the new module search path.
8648c8fe68SPeter PentchevIf the path has been changed, and the
8748c8fe68SPeter Pentchev.Fl v
8848c8fe68SPeter Pentchevflag is specified more than once, the old path is displayed as well.
8948c8fe68SPeter Pentchev.El
9048c8fe68SPeter Pentchev.Sh FILES
9148c8fe68SPeter Pentchev.Bl -tag -width indent
9253e6653dSRuslan Ermilov.It Pa /boot/kernel , /boot/modules , /modules
9348c8fe68SPeter PentchevThe default module search path used by the kernel.
9448c8fe68SPeter Pentchev.El
95a866e170SRuslan Ermilov.Sh EXIT STATUS
96a866e170SRuslan Ermilov.Ex -std
97*cf0fd1f8SFernando Apesteguía.Sh EXAMPLES
98*cf0fd1f8SFernando ApesteguíaShow the module search path
99*cf0fd1f8SFernando Apesteguía.Bd -literal -offset indent
100*cf0fd1f8SFernando Apesteguía$ kldconfig -r
101*cf0fd1f8SFernando Apesteguía/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays
102*cf0fd1f8SFernando Apesteguía.Ed
103*cf0fd1f8SFernando Apesteguía.Pp
104*cf0fd1f8SFernando ApesteguíaTry to delete the
105*cf0fd1f8SFernando Apesteguía.Pa /boot
106*cf0fd1f8SFernando Apesteguíadirectory from the search path.
107*cf0fd1f8SFernando ApesteguíaThe command will fail:
108*cf0fd1f8SFernando Apesteguía.Bd -literal -offset indent
109*cf0fd1f8SFernando Apesteguía$ kldconfig -d /boot
110*cf0fd1f8SFernando Apesteguíakldconfig: not in module search path: /boot
111*cf0fd1f8SFernando Apesteguía$ echo $?
112*cf0fd1f8SFernando Apesteguía1
113*cf0fd1f8SFernando Apesteguía.Ed
114*cf0fd1f8SFernando Apesteguía.Pp
115*cf0fd1f8SFernando ApesteguíaSame as above but forcing the operation.
116*cf0fd1f8SFernando ApesteguíaThis time the command will succeed:
117*cf0fd1f8SFernando Apesteguía.Bd -literal -offset indent
118*cf0fd1f8SFernando Apesteguía$ kldconfig -d -f /boot
119*cf0fd1f8SFernando Apesteguía$ echo $?
120*cf0fd1f8SFernando Apesteguía0
121*cf0fd1f8SFernando Apesteguía.Ed
122*cf0fd1f8SFernando Apesteguía.Pp
123*cf0fd1f8SFernando ApesteguíaAdd the
124*cf0fd1f8SFernando Apesteguía.Pa /boot
125*cf0fd1f8SFernando Apesteguíadirectory to the beginning of the search path and display extra verbose output:
126*cf0fd1f8SFernando Apesteguía.Bd -literal -offset indent
127*cf0fd1f8SFernando Apesteguía$ kldconfig -i -m -vv /boot
128*cf0fd1f8SFernando Apesteguía/boot/kernel;/boot/modules -> /boot;/boot/kernel;/boot/modules
129*cf0fd1f8SFernando Apesteguía.Ed
130*cf0fd1f8SFernando Apesteguía.Pp
131*cf0fd1f8SFernando ApesteguíaWithout
132*cf0fd1f8SFernando Apesteguía.Fl m
133*cf0fd1f8SFernando Apesteguíathe
134*cf0fd1f8SFernando Apesteguía.Fl i
135*cf0fd1f8SFernando Apesteguíaflag will overwrite the contents of the search path list:
136*cf0fd1f8SFernando Apesteguía.Bd -literal -offset indent
137*cf0fd1f8SFernando Apesteguía$ kldconfig -i -vv /boot
138*cf0fd1f8SFernando Apesteguía/boot;/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays -> /boot
139*cf0fd1f8SFernando Apesteguía.Ed
140*cf0fd1f8SFernando Apesteguía.Pp
141*cf0fd1f8SFernando ApesteguíaSame as above but using
142*cf0fd1f8SFernando Apesteguía.Fl n
143*cf0fd1f8SFernando Apesteguíato simulate the operation without actually doing it:
144*cf0fd1f8SFernando Apesteguía.Bd -literal -offset indent
145*cf0fd1f8SFernando Apesteguía$ kldconfig -i -n -vv /boot
146*cf0fd1f8SFernando Apesteguía/boot;/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays -> /boot
147*cf0fd1f8SFernando Apesteguía.Ed
148*cf0fd1f8SFernando Apesteguía.Pp
149*cf0fd1f8SFernando ApesteguíaAdd directories to the search path removing duplicates.
150*cf0fd1f8SFernando ApesteguíaNote the need of
151*cf0fd1f8SFernando Apesteguía.Fl f
152*cf0fd1f8SFernando Apesteguíato force the operation in case any of the directories is already in the
153*cf0fd1f8SFernando Apesteguíasearch path.
154*cf0fd1f8SFernando ApesteguíaThe
155*cf0fd1f8SFernando Apesteguía.Pa /boot/kernel
156*cf0fd1f8SFernando Apesteguíadirectory will be added once:
157*cf0fd1f8SFernando Apesteguía.Bd -literal -offset indent
158*cf0fd1f8SFernando Apesteguía$ kldconfig -f -U /boot/kernel /boot/kernel /boot/modules /boot/dtb /boot/dtb/overlays
159*cf0fd1f8SFernando Apesteguía.Ed
16048c8fe68SPeter Pentchev.Sh SEE ALSO
16148c8fe68SPeter Pentchev.Xr kldload 2 ,
16248c8fe68SPeter Pentchev.Xr kldload 8 ,
163461ef81dSEdward Tomasz Napierala.Xr kldxref 8 ,
16448c8fe68SPeter Pentchev.Xr sysctl 8
16548c8fe68SPeter Pentchev.Sh HISTORY
16648c8fe68SPeter PentchevThe
16748c8fe68SPeter Pentchev.Nm
16848c8fe68SPeter Pentchevutility first appeared in
169b1161924SDavid E. O'Brien.Fx 4.4 .
17048c8fe68SPeter Pentchev.Sh AUTHORS
171bd0891ceSBaptiste Daroussin.An Peter Pentchev Aq Mt roam@FreeBSD.org
172