xref: /freebsd/sbin/kldconfig/kldconfig.8 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
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.\"
26*cf0fd1f8SFernando Apesteguía.Dd September 29, 2020
2748c8fe68SPeter Pentchev.Dt KLDCONFIG 8
2848c8fe68SPeter Pentchev.Os
2948c8fe68SPeter Pentchev.Sh NAME
3048c8fe68SPeter Pentchev.Nm kldconfig
3148c8fe68SPeter Pentchev.Nd display or modify the kernel module search path
3248c8fe68SPeter Pentchev.Sh SYNOPSIS
3348c8fe68SPeter Pentchev.Nm
3448c8fe68SPeter Pentchev.Op Fl dfimnUv
358d646af5SRuslan Ermilov.Op Fl S Ar sysctlname
3648c8fe68SPeter Pentchev.Op Ar path ...
3748c8fe68SPeter Pentchev.Nm
3848c8fe68SPeter Pentchev.Fl r
3948c8fe68SPeter Pentchev.Sh DESCRIPTION
40e1205e80SPhilippe CharnierThe
4148c8fe68SPeter Pentchev.Nm
42e1205e80SPhilippe Charnierutility
4348c8fe68SPeter Pentchevdisplays or modifies the search path used by the kernel when loading modules
4448c8fe68SPeter Pentchevusing the
4548c8fe68SPeter Pentchev.Xr kldload 8
4648c8fe68SPeter Pentchevutility or the
4748c8fe68SPeter Pentchev.Xr kldload 2
4848c8fe68SPeter Pentchevsyscall.
4948c8fe68SPeter Pentchev.Pp
5048c8fe68SPeter PentchevThe following options are available:
5148c8fe68SPeter Pentchev.Bl -tag -width indent
5248c8fe68SPeter Pentchev.It Fl d
5348c8fe68SPeter PentchevRemove the specified paths from the module search path.
5448c8fe68SPeter Pentchev.It Fl f
55*cf0fd1f8SFernando ApesteguíaDo not fail if a path specified for adding is already present in the search
56*cf0fd1f8SFernando Apesteguíapath, or if a path specified for removing is not present in the search path.
5748c8fe68SPeter PentchevThis may be useful in startup/shutdown scripts for adding a path to
5848c8fe68SPeter Pentcheva file system which is still not mounted, or in shutdown scripts for
5948c8fe68SPeter Pentchevunconditionally removing a path that may have been added during startup.
6048c8fe68SPeter Pentchev.It Fl i
6148c8fe68SPeter PentchevAdd the specified paths to the beginning of the search path, not to the end.
6248c8fe68SPeter PentchevThis option can only be used when adding paths.
6348c8fe68SPeter Pentchev.It Fl m
6448c8fe68SPeter PentchevInstead of replacing the module search path with the set of paths
6548c8fe68SPeter Pentchevspecified,
6648c8fe68SPeter Pentchev.Dq merge
6748c8fe68SPeter Pentchevin the new entries.
6848c8fe68SPeter Pentchev.It Fl n
6948c8fe68SPeter PentchevDo not actually change the module search path.
7048c8fe68SPeter Pentchev.It Fl r
7148c8fe68SPeter PentchevDisplay the current search path.
7248c8fe68SPeter PentchevThis option cannot be used if any paths are also specified.
738d646af5SRuslan Ermilov.It Fl S Ar sysctlname
7448c8fe68SPeter PentchevSpecify the sysctl name to use instead of the default
7548c8fe68SPeter Pentchev.Va kern.module_path .
7648c8fe68SPeter Pentchev.It Fl U
7748c8fe68SPeter Pentchev.Dq Unique-ify
7848c8fe68SPeter Pentchevthe current search path - if any of the directories is repeated one
7948c8fe68SPeter Pentchevor more times, only the first occurrence remains.
8048c8fe68SPeter PentchevThis option implies
8148c8fe68SPeter Pentchev.Fl m .
8248c8fe68SPeter Pentchev.It Fl v
8348c8fe68SPeter PentchevVerbose output: display the new module search path.
8448c8fe68SPeter PentchevIf the path has been changed, and the
8548c8fe68SPeter Pentchev.Fl v
8648c8fe68SPeter Pentchevflag is specified more than once, the old path is displayed as well.
8748c8fe68SPeter Pentchev.El
8848c8fe68SPeter Pentchev.Sh FILES
8948c8fe68SPeter Pentchev.Bl -tag -width indent
9053e6653dSRuslan Ermilov.It Pa /boot/kernel , /boot/modules , /modules
9148c8fe68SPeter PentchevThe default module search path used by the kernel.
9248c8fe68SPeter Pentchev.El
93a866e170SRuslan Ermilov.Sh EXIT STATUS
94a866e170SRuslan Ermilov.Ex -std
95*cf0fd1f8SFernando Apesteguía.Sh EXAMPLES
96*cf0fd1f8SFernando ApesteguíaShow the module search path
97*cf0fd1f8SFernando Apesteguía.Bd -literal -offset indent
98*cf0fd1f8SFernando Apesteguía$ kldconfig -r
99*cf0fd1f8SFernando Apesteguía/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays
100*cf0fd1f8SFernando Apesteguía.Ed
101*cf0fd1f8SFernando Apesteguía.Pp
102*cf0fd1f8SFernando ApesteguíaTry to delete the
103*cf0fd1f8SFernando Apesteguía.Pa /boot
104*cf0fd1f8SFernando Apesteguíadirectory from the search path.
105*cf0fd1f8SFernando ApesteguíaThe command will fail:
106*cf0fd1f8SFernando Apesteguía.Bd -literal -offset indent
107*cf0fd1f8SFernando Apesteguía$ kldconfig -d /boot
108*cf0fd1f8SFernando Apesteguíakldconfig: not in module search path: /boot
109*cf0fd1f8SFernando Apesteguía$ echo $?
110*cf0fd1f8SFernando Apesteguía1
111*cf0fd1f8SFernando Apesteguía.Ed
112*cf0fd1f8SFernando Apesteguía.Pp
113*cf0fd1f8SFernando ApesteguíaSame as above but forcing the operation.
114*cf0fd1f8SFernando ApesteguíaThis time the command will succeed:
115*cf0fd1f8SFernando Apesteguía.Bd -literal -offset indent
116*cf0fd1f8SFernando Apesteguía$ kldconfig -d -f /boot
117*cf0fd1f8SFernando Apesteguía$ echo $?
118*cf0fd1f8SFernando Apesteguía0
119*cf0fd1f8SFernando Apesteguía.Ed
120*cf0fd1f8SFernando Apesteguía.Pp
121*cf0fd1f8SFernando ApesteguíaAdd the
122*cf0fd1f8SFernando Apesteguía.Pa /boot
123*cf0fd1f8SFernando Apesteguíadirectory to the beginning of the search path and display extra verbose output:
124*cf0fd1f8SFernando Apesteguía.Bd -literal -offset indent
125*cf0fd1f8SFernando Apesteguía$ kldconfig -i -m -vv /boot
126*cf0fd1f8SFernando Apesteguía/boot/kernel;/boot/modules -> /boot;/boot/kernel;/boot/modules
127*cf0fd1f8SFernando Apesteguía.Ed
128*cf0fd1f8SFernando Apesteguía.Pp
129*cf0fd1f8SFernando ApesteguíaWithout
130*cf0fd1f8SFernando Apesteguía.Fl m
131*cf0fd1f8SFernando Apesteguíathe
132*cf0fd1f8SFernando Apesteguía.Fl i
133*cf0fd1f8SFernando Apesteguíaflag will overwrite the contents of the search path list:
134*cf0fd1f8SFernando Apesteguía.Bd -literal -offset indent
135*cf0fd1f8SFernando Apesteguía$ kldconfig -i -vv /boot
136*cf0fd1f8SFernando Apesteguía/boot;/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays -> /boot
137*cf0fd1f8SFernando Apesteguía.Ed
138*cf0fd1f8SFernando Apesteguía.Pp
139*cf0fd1f8SFernando ApesteguíaSame as above but using
140*cf0fd1f8SFernando Apesteguía.Fl n
141*cf0fd1f8SFernando Apesteguíato simulate the operation without actually doing it:
142*cf0fd1f8SFernando Apesteguía.Bd -literal -offset indent
143*cf0fd1f8SFernando Apesteguía$ kldconfig -i -n -vv /boot
144*cf0fd1f8SFernando Apesteguía/boot;/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays -> /boot
145*cf0fd1f8SFernando Apesteguía.Ed
146*cf0fd1f8SFernando Apesteguía.Pp
147*cf0fd1f8SFernando ApesteguíaAdd directories to the search path removing duplicates.
148*cf0fd1f8SFernando ApesteguíaNote the need of
149*cf0fd1f8SFernando Apesteguía.Fl f
150*cf0fd1f8SFernando Apesteguíato force the operation in case any of the directories is already in the
151*cf0fd1f8SFernando Apesteguíasearch path.
152*cf0fd1f8SFernando ApesteguíaThe
153*cf0fd1f8SFernando Apesteguía.Pa /boot/kernel
154*cf0fd1f8SFernando Apesteguíadirectory will be added once:
155*cf0fd1f8SFernando Apesteguía.Bd -literal -offset indent
156*cf0fd1f8SFernando Apesteguía$ kldconfig -f -U /boot/kernel /boot/kernel /boot/modules /boot/dtb /boot/dtb/overlays
157*cf0fd1f8SFernando Apesteguía.Ed
15848c8fe68SPeter Pentchev.Sh SEE ALSO
15948c8fe68SPeter Pentchev.Xr kldload 2 ,
16048c8fe68SPeter Pentchev.Xr kldload 8 ,
161461ef81dSEdward Tomasz Napierala.Xr kldxref 8 ,
16248c8fe68SPeter Pentchev.Xr sysctl 8
16348c8fe68SPeter Pentchev.Sh HISTORY
16448c8fe68SPeter PentchevThe
16548c8fe68SPeter Pentchev.Nm
16648c8fe68SPeter Pentchevutility first appeared in
167b1161924SDavid E. O'Brien.Fx 4.4 .
16848c8fe68SPeter Pentchev.Sh AUTHORS
169bd0891ceSBaptiste Daroussin.An Peter Pentchev Aq Mt roam@FreeBSD.org
170