2 .\" Copyright (c) 2017-2021 Netflix, Inc.
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 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
32 .Nd UEFI environment variable interaction
44 .Op Fl -fromfile Ar file
60 .Dq Unified Extensible Firmware Interface
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
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.
70 The following options are available:
72 .It Fl n Ar name Fl -name Ar name
73 Specify the name of the variable to operate on.
76 argument is the GUID of the variable, followed by a dash, followed by the
78 The GUID may be in numeric format, or may be one of the well known
82 .It Fl f Ar file Fl -fromfile Ar file
83 When writing or appending to a variable, take the data for the
86 instead of from the command line.
94 This behavior is not well understood and is currently unimplemented
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
103 Append the specified value to the UEFI variable rather than replacing
105 .It Fl t Ar attr Fl -attributes Ar attr
106 Specify, in hexadecimal, the attributes for this
108 See section 7.2 (GetVariable subsection, Related Definitions) of the
109 UEFI Specification for hex values to use.
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.
115 Display the variable data as binary data.
116 Usually will be used with the
123 Delete the specified variable.
124 May not be used with either the
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.
136 Convert GUIDs to names if they are known
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
149 List all the variables.
152 flag is also listed, their values will be displayed.
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.
157 Do not display the variable name.
159 Print the value of the variable.
161 When an error occurs, exit with a non-zero value without outputting
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.
167 Treat the value of the variable as UCS2 and convert it to UTF8 and
170 Write (replace) the variable specified with the value specified from
172 No command line option to do this is available since UEFI variables
173 are binary structures rather than strings.
176 can be used to specify simple strings.
180 environment variable.
185 program is intended to be compatible (strict superset) with a program
186 of the same name included in the Red Hat libefivar package,
191 flags are not implemented and never will be.
198 Appendix A of the UEFI specification has the format for GUIDs.
200 .Dq Globally Unique Identifiers
201 have the format described in RFC 4122.
205 utility first appeared in