2 .\" Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd list or modify the kernel environment
39 .Ar variable Ns Op = Ns Ar value
47 utility will list all variables in the kernel environment if
48 invoked without arguments.
52 option is specified, then the static environment provided by
54 will be listed instead.
57 option will list the static environment defined by the kernel config.
62 options are dependent on the kernel being configured to preserve early kernel
64 The default kernel configuration does not preserve these environments.
68 option is specified, it will limit the report to kernel probe hints.
73 will only report that value.
78 will only display variable names and not their values.
83 will delete the given environment variable.
84 If the environment variable is followed by an optional
87 will set the environment variable to this value.
91 option is set, warnings normally printed as a result of being unable to
92 perform the requested operation will be suppressed.
96 option is set, the variable name will be printed out for the
97 environment variable in addition to the value when
99 is executed with a variable name.
101 Variables can be added to the kernel environment using the
102 .Pa /boot/loader.conf
103 file, or also statically compiled into the kernel using the statement
105 .Dl Ic env Ar filename
107 in the kernel config file.
108 The file can contain lines of the form
110 .Dl name = "value" # this is a comment
112 where whitespace around
116 and everything after a
118 character, are ignored.
119 Almost any printable character except
121 is acceptable as part of a name.
122 Quotes are optional and necessary only if the value contains whitespace.
124 Show kernel probe hints variable names and filter for the uart
126 .Bd -literal -offset indent
127 $ kenv -h -N | grep uart
137 Show the value of a specific variable:
138 .Bd -literal -offset indent
139 $ kenv hint.uart.1.at
143 Same as above but adding the name of the variable in the report:
144 .Bd -literal -offset indent
145 $ kenv -v hint.uart.1.at
149 Try to delete a variable and suppress warnings if any:
150 .Bd -literal -offset indent
151 $ kenv -q -u hint.uart.1.at
157 .Bd -literal -offset indent
158 $ kenv verbose_loading="YES"
159 verbose_loading="YES"