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