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