Skip to content

Commit

Permalink
kldconfig(8): Add EXAMPLES to the man page
Browse files Browse the repository at this point in the history
Add EXAMPLES section to the man page showing the use of all flags except for
-S.

While here, clarify -f description. It not only suppresses diagnostic messages
but it also affects the exit status of the command itself. This is shown in two
of the examples.

Approved by:	bcr@
Differential Revision:	https://reviews.freebsd.org/D26588
  • Loading branch information
fernape committed Sep 29, 2020
1 parent 6ab1ffc commit cf0fd1f
Showing 1 changed file with 66 additions and 4 deletions.
70 changes: 66 additions & 4 deletions sbin/kldconfig/kldconfig.8
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd April 27, 2017
.Dd September 29, 2020
.Dt KLDCONFIG 8
.Os
.Sh NAME
Expand Down Expand Up @@ -54,9 +54,8 @@ The following options are available:
.It Fl d
Remove the specified paths from the module search path.
.It Fl f
Do not display a diagnostic message if a path specified for adding is
already present in the search path, or if a path specified for removing
is not present in the search path.
Do not fail if a path specified for adding is already present in the search
path, or if a path specified for removing is not present in the search path.
This may be useful in startup/shutdown scripts for adding a path to
a file system which is still not mounted, or in shutdown scripts for
unconditionally removing a path that may have been added during startup.
Expand Down Expand Up @@ -95,6 +94,69 @@ The default module search path used by the kernel.
.El
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
Show the module search path
.Bd -literal -offset indent
$ kldconfig -r
/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays
.Ed
.Pp
Try to delete the
.Pa /boot
directory from the search path.
The command will fail:
.Bd -literal -offset indent
$ kldconfig -d /boot
kldconfig: not in module search path: /boot
$ echo $?
1
.Ed
.Pp
Same as above but forcing the operation.
This time the command will succeed:
.Bd -literal -offset indent
$ kldconfig -d -f /boot
$ echo $?
0
.Ed
.Pp
Add the
.Pa /boot
directory to the beginning of the search path and display extra verbose output:
.Bd -literal -offset indent
$ kldconfig -i -m -vv /boot
/boot/kernel;/boot/modules -> /boot;/boot/kernel;/boot/modules
.Ed
.Pp
Without
.Fl m
the
.Fl i
flag will overwrite the contents of the search path list:
.Bd -literal -offset indent
$ kldconfig -i -vv /boot
/boot;/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays -> /boot
.Ed
.Pp
Same as above but using
.Fl n
to simulate the operation without actually doing it:
.Bd -literal -offset indent
$ kldconfig -i -n -vv /boot
/boot;/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays -> /boot
.Ed
.Pp
Add directories to the search path removing duplicates.
Note the need of
.Fl f
to force the operation in case any of the directories is already in the
search path.
The
.Pa /boot/kernel
directory will be added once:
.Bd -literal -offset indent
$ kldconfig -f -U /boot/kernel /boot/kernel /boot/modules /boot/dtb /boot/dtb/overlays
.Ed
.Sh SEE ALSO
.Xr kldload 2 ,
.Xr kldload 8 ,
Expand Down

0 comments on commit cf0fd1f

Please sign in to comment.