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
30 .Nd list or modify the kernel environment
37 .Ar variable Ns Op = Ns Ar value
45 utility will list all variables in the kernel environment if
46 invoked without arguments.
50 option is specified, then the static environment provided by
52 will be listed instead.
55 option will list the static environment defined by the kernel config.
60 options are dependent on the kernel being configured to preserve early kernel
62 The default kernel configuration does not preserve these environments.
66 option is specified, it will limit the report to kernel probe hints.
71 will only report that value.
76 will only display variable names and not their values.
81 will delete the given environment variable.
82 If the environment variable is followed by an optional
85 will set the environment variable to this value.
89 option is set, warnings normally printed as a result of being unable to
90 perform the requested operation will be suppressed.
94 option is set, the variable name will be printed out for the
95 environment variable in addition to the value when
97 is executed with a variable name.
99 Variables can be added to the kernel environment using the
100 .Pa /boot/loader.conf
101 file, or also statically compiled into the kernel using the statement
103 .Dl Ic env Ar filename
105 in the kernel config file.
106 The file can contain lines of the form
108 .Dl name = "value" # this is a comment
110 where whitespace around
114 and everything after a
116 character, are ignored.
117 Almost any printable character except
119 is acceptable as part of a name.
120 Quotes are optional and necessary only if the value contains whitespace.
122 Show kernel probe hints variable names and filter for the uart
124 .Bd -literal -offset indent
125 $ kenv -h -N | grep uart
135 Show the value of a specific variable:
136 .Bd -literal -offset indent
137 $ kenv hint.uart.1.at
141 Same as above but adding the name of the variable in the report:
142 .Bd -literal -offset indent
143 $ kenv -v hint.uart.1.at
147 Try to delete a variable and suppress warnings if any:
148 .Bd -literal -offset indent
149 $ kenv -q -u hint.uart.1.at
155 .Bd -literal -offset indent
156 $ kenv verbose_loading="YES"
157 verbose_loading="YES"