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