]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/efivar/efivar.8
Import device-tree files from Linux 6.1
[FreeBSD/FreeBSD.git] / usr.sbin / efivar / efivar.8
1 .\"
2 .\" Copyright (c) 2017-2021 Netflix, Inc.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
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.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd April 7, 2021
28 .Dt EFIVAR 8
29 .Os
30 .Sh NAME
31 .Nm efivar
32 .Nd UEFI environment variable interaction
33 .Sh SYNOPSIS
34 .Nm
35 .Op Fl abdDHlLNpqRtuw
36 .Op Fl n Ar name
37 .Op Fl f Ar file
38 .Op Fl -append
39 .Op Fl -ascii
40 .Op Fl -attributes
41 .Op Fl -binary
42 .Op Fl -delete
43 .Op Fl -device-path
44 .Op Fl -fromfile Ar file
45 .Op Fl -guid
46 .Op Fl -hex
47 .Op Fl -list-guids
48 .Op Fl -list
49 .Op Fl -load-option
50 .Op Fl -name Ar name
51 .Op Fl -no-name
52 .Op Fl -print
53 .Op Fl -print-decimal
54 .Op Fl -quiet
55 .Op Fl -raw-guid
56 .Op Fl -utf8
57 .Op Fl -write
58 .Sh DESCRIPTION
59 This program manages
60 .Dq Unified Extensible Firmware Interface
61 .Pq UEFI
62 environment variables.
63 UEFI variables have three parts: A namespace, a name and a value.
64 The namespace is a GUID that is self assigned by the group defining the
65 variables.
66 The name is a Unicode name for the variable.
67 The value is binary data.
68 All Unicode data is presented to the user as UTF-8.
69 .Pp
70 The following options are available:
71 .Bl -tag -width 20m
72 .It Fl n Ar name Fl -name Ar name
73 Specify the name of the variable to operate on.
74 The
75 .Ar name
76 argument is the GUID of the variable, followed by a dash, followed by the
77 UEFI variable name.
78 The GUID may be in numeric format, or may be one of the well known
79 symbolic names (see
80 .Fl -list-guids
81 for a complete list).
82 .It Fl f Ar file Fl -fromfile Ar file
83 When writing or appending to a variable, take the data for the
84 variable's value from
85 .Ar file
86 instead of from the command line.
87 This flag implies
88 .Fl -write
89 unless the
90 .Fl -append
91 or
92 .Fl -print
93 flags are given.
94 This behavior is not well understood and is currently unimplemented
95 for writes.
96 When
97 .Fl -print
98 is specified, the contents of the file are used as the value to
99 print using any other specified flags.
100 This is used primarily for testing purposes for more complicated
101 variable decoding.
102 .It Fl a Fl -append
103 Append the specified value to the UEFI variable rather than replacing
104 it.
105 .It Fl t Ar attr Fl -attributes Ar attr
106 Specify, in hexadecimal, the attributes for this
107 variable.
108 See section 7.2 (GetVariable subsection, Related Definitions) of the
109 UEFI Specification for hex values to use.
110 .It Fl A Fl -ascii
111 Display the variable data as modified ASCII: All printable characters
112 are printed, while unprintable characters are rendered as a two-digit
113 hexadecimal number preceded by a % character.
114 .It Fl b Fl -binary
115 Display the variable data as binary data.
116 Usually will be used with the
117 .Fl N
118 or
119 .Fl -no-name
120 flag.
121 Useful in scripts.
122 .It Fl D Fl -delete
123 Delete the specified variable.
124 May not be used with either the
125 .Fl -write
126 or the
127 .Fl -append
128 flags.
129 No
130 .Ar value
131 may be specified.
132 .It Fl d Fl -device Fl -device-path
133 Interpret the variables printed as UEFI device paths and print the
134 UEFI standard string representation.
135 .It Fl g Fl -guid
136 Convert GUIDs to names if they are known
137 .Po and show them in
138 .Fl -list-guids
139 .Pc .
140 .It Fl H Fl -hex
141 List variable data as a hex dump.
142 .It Fl L Fl -list-guids
143 Lists the well known GUIDs.
144 The names listed here may be used in place of the numeric GUID values.
145 These names will replace the numeric GUID values unless the
146 .Fl -raw-guid
147 flag is specified.
148 .It Fl l Fl -list
149 List all the variables.
150 If the
151 .Fl -print
152 flag is also listed, their values will be displayed.
153 .It Fl -load-option
154 Decode the variable as if it were a UEFI Boot Option, including information
155 about what device and/or paths the UEFI DevicePaths decode to.
156 .It Fl N Fl -no-name
157 Do not display the variable name.
158 .It Fl p Fl -print
159 Print the value of the variable.
160 .It Fl q Fl -quiet
161 When an error occurs, exit with a non-zero value without outputting
162 any error messages.
163 Otherwise, produce the normal output and exit with a zero status.
164 .It Fl R Fl -raw-guid
165 Do not substitute well known names for GUID numeric values in output.
166 .It Fl u Fl -utf8
167 Treat the value of the variable as UCS2 and convert it to UTF8 and
168 print the result.
169 .It Fl w Fl -write
170 Write (replace) the variable specified with the value specified from
171 standard input.
172 No command line option to do this is available since UEFI variables
173 are binary structures rather than strings.
174 .Xr echo 1
175 .Fl n
176 can be used to specify simple strings.
177 .It Ar name
178 Display the
179 .Ar name
180 environment variable.
181 .El
182 .Sh COMPATIBILITY
183 The
184 .Nm
185 program is intended to be compatible (strict superset) with a program
186 of the same name included in the Red Hat libefivar package,
187 but the
188 .Fl d
189 and
190 .Fl -print-decimal
191 flags are not implemented and never will be.
192 .Pp
193 The
194 .Fl d
195 flag is short for
196 .Fl -device-path .
197 .Sh SEE ALSO
198 Appendix A of the UEFI specification has the format for GUIDs.
199 All GUIDs
200 .Dq Globally Unique Identifiers
201 have the format described in RFC 4122.
202 .Sh HISTORY
203 The
204 .Nm
205 utility first appeared in
206 .Fx 11.1 .