2019-02-04 21:28:25 +00:00
|
|
|
.\"
|
2021-04-09 22:35:08 +00:00
|
|
|
.\" Copyright (c) 2017-2021 Netflix, Inc.
|
2016-10-11 22:31:45 +00:00
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
2016-10-13 06:56:23 +00:00
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
2016-10-11 22:31:45 +00:00
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
2016-10-13 06:56:23 +00:00
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
2016-10-11 22:31:45 +00:00
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
2021-04-09 22:35:08 +00:00
|
|
|
.Dd April 7, 2021
|
2016-10-11 22:31:45 +00:00
|
|
|
.Dt EFIVAR 8
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm efivar
|
2017-05-21 22:10:08 +00:00
|
|
|
.Nd UEFI environment variable interaction
|
2016-10-11 22:31:45 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2021-04-09 22:35:08 +00:00
|
|
|
.Op Fl abdDHlLNpqRtuw
|
2016-10-11 22:31:45 +00:00
|
|
|
.Op Fl n Ar name
|
|
|
|
.Op Fl f Ar file
|
|
|
|
.Op Fl -append
|
|
|
|
.Op Fl -ascii
|
|
|
|
.Op Fl -attributes
|
|
|
|
.Op Fl -binary
|
|
|
|
.Op Fl -delete
|
2017-03-09 00:31:36 +00:00
|
|
|
.Op Fl -device-path
|
2016-10-11 22:31:45 +00:00
|
|
|
.Op Fl -fromfile Ar file
|
2017-03-03 20:23:10 +00:00
|
|
|
.Op Fl -guid
|
2016-10-11 22:31:45 +00:00
|
|
|
.Op Fl -hex
|
|
|
|
.Op Fl -list-guids
|
|
|
|
.Op Fl -list
|
2019-03-07 00:01:28 +00:00
|
|
|
.Op Fl -load-option
|
2016-10-11 22:31:45 +00:00
|
|
|
.Op Fl -name Ar name
|
|
|
|
.Op Fl -no-name
|
|
|
|
.Op Fl -print
|
|
|
|
.Op Fl -print-decimal
|
2021-04-09 22:35:08 +00:00
|
|
|
.Op Fl -quiet
|
2016-10-11 22:31:45 +00:00
|
|
|
.Op Fl -raw-guid
|
2017-08-31 17:53:50 +00:00
|
|
|
.Op Fl -utf8
|
2016-10-11 22:31:45 +00:00
|
|
|
.Op Fl -write
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
This program manages
|
|
|
|
.Dq Unified Extensible Firmware Interface
|
|
|
|
.Pq UEFI
|
|
|
|
environment variables.
|
2022-03-12 09:43:39 +00:00
|
|
|
UEFI variables have three parts: A namespace, a name and a value.
|
2017-05-21 22:10:08 +00:00
|
|
|
The namespace is a GUID that is self assigned by the group defining the
|
2016-10-11 22:31:45 +00:00
|
|
|
variables.
|
|
|
|
The name is a Unicode name for the variable.
|
|
|
|
The value is binary data.
|
|
|
|
All Unicode data is presented to the user as UTF-8.
|
|
|
|
.Pp
|
|
|
|
The following options are available:
|
|
|
|
.Bl -tag -width 20m
|
|
|
|
.It Fl n Ar name Fl -name Ar name
|
|
|
|
Specify the name of the variable to operate on.
|
|
|
|
The
|
|
|
|
.Ar name
|
2017-05-21 22:10:08 +00:00
|
|
|
argument is the GUID of the variable, followed by a dash, followed by the
|
2016-10-11 22:31:45 +00:00
|
|
|
UEFI variable name.
|
|
|
|
The GUID may be in numeric format, or may be one of the well known
|
2022-03-12 09:43:39 +00:00
|
|
|
symbolic names (see
|
2016-10-11 22:31:45 +00:00
|
|
|
.Fl -list-guids
|
|
|
|
for a complete list).
|
|
|
|
.It Fl f Ar file Fl -fromfile Ar file
|
|
|
|
When writing or appending to a variable, take the data for the
|
|
|
|
variable's value from
|
|
|
|
.Ar file
|
|
|
|
instead of from the command line.
|
|
|
|
This flag implies
|
|
|
|
.Fl -write
|
|
|
|
unless the
|
|
|
|
.Fl -append
|
2018-10-26 22:13:40 +00:00
|
|
|
or
|
|
|
|
.Fl -print
|
|
|
|
flags are given.
|
|
|
|
This behavior is not well understood and is currently unimplemented
|
|
|
|
for writes.
|
|
|
|
When
|
|
|
|
.Fl -print
|
|
|
|
is specified, the contents of the file are used as the value to
|
|
|
|
print using any other specified flags.
|
|
|
|
This is used primarily for testing purposes for more complicated
|
|
|
|
variable decoding.
|
2016-10-11 22:31:45 +00:00
|
|
|
.It Fl a Fl -append
|
|
|
|
Append the specified value to the UEFI variable rather than replacing
|
2017-05-21 22:10:08 +00:00
|
|
|
it.
|
2016-10-11 22:31:45 +00:00
|
|
|
.It Fl t Ar attr Fl -attributes Ar attr
|
2017-05-21 22:10:08 +00:00
|
|
|
Specify, in hexadecimal, the attributes for this
|
2016-10-11 22:31:45 +00:00
|
|
|
variable.
|
|
|
|
See section 7.2 (GetVariable subsection, Related Definitions) of the
|
|
|
|
UEFI Specification for hex values to use.
|
|
|
|
.It Fl A Fl -ascii
|
2022-03-12 09:43:39 +00:00
|
|
|
Display the variable data as modified ASCII: All printable characters
|
2016-10-11 22:31:45 +00:00
|
|
|
are printed, while unprintable characters are rendered as a two-digit
|
2017-05-21 22:10:08 +00:00
|
|
|
hexadecimal number preceded by a % character.
|
2016-10-13 17:03:54 +00:00
|
|
|
.It Fl b Fl -binary
|
2016-10-11 22:31:45 +00:00
|
|
|
Display the variable data as binary data.
|
|
|
|
Usually will be used with the
|
|
|
|
.Fl N
|
|
|
|
or
|
|
|
|
.Fl -no-name
|
|
|
|
flag.
|
|
|
|
Useful in scripts.
|
|
|
|
.It Fl D Fl -delete
|
|
|
|
Delete the specified variable.
|
|
|
|
May not be used with either the
|
|
|
|
.Fl -write
|
|
|
|
or the
|
|
|
|
.Fl -append
|
|
|
|
flags.
|
|
|
|
No
|
|
|
|
.Ar value
|
|
|
|
may be specified.
|
2017-03-09 00:31:36 +00:00
|
|
|
.It Fl d Fl -device Fl -device-path
|
|
|
|
Interpret the variables printed as UEFI device paths and print the
|
|
|
|
UEFI standard string representation.
|
2017-03-03 20:23:10 +00:00
|
|
|
.It Fl g Fl -guid
|
2020-06-18 12:29:24 +00:00
|
|
|
Convert GUIDs to names if they are known
|
2022-03-12 09:43:39 +00:00
|
|
|
.Po and show them in
|
2020-06-18 12:29:24 +00:00
|
|
|
.Fl -list-guids
|
|
|
|
.Pc .
|
2016-10-11 22:31:45 +00:00
|
|
|
.It Fl H Fl -hex
|
|
|
|
List variable data as a hex dump.
|
|
|
|
.It Fl L Fl -list-guids
|
|
|
|
Lists the well known GUIDs.
|
|
|
|
The names listed here may be used in place of the numeric GUID values.
|
2022-03-12 09:43:39 +00:00
|
|
|
These names will replace the numeric GUID values unless the
|
2016-10-11 22:31:45 +00:00
|
|
|
.Fl -raw-guid
|
|
|
|
flag is specified.
|
|
|
|
.It Fl l Fl -list
|
|
|
|
List all the variables.
|
|
|
|
If the
|
|
|
|
.Fl -print
|
|
|
|
flag is also listed, their values will be displayed.
|
2019-03-07 00:01:28 +00:00
|
|
|
.It Fl -load-option
|
2022-03-12 09:43:39 +00:00
|
|
|
Decode the variable as if it were a UEFI Boot Option, including information
|
|
|
|
about what device and/or paths the UEFI DevicePaths decode to.
|
2016-10-11 22:31:45 +00:00
|
|
|
.It Fl N Fl -no-name
|
|
|
|
Do not display the variable name.
|
|
|
|
.It Fl p Fl -print
|
|
|
|
Print the value of the variable.
|
2021-04-09 22:35:08 +00:00
|
|
|
.It Fl q Fl -quiet
|
2022-03-12 09:43:39 +00:00
|
|
|
When an error occurs, exit with a non-zero value without outputting
|
|
|
|
any error messages.
|
2021-04-09 22:35:08 +00:00
|
|
|
Otherwise, produce the normal output and exit with a zero status.
|
2016-10-11 22:31:45 +00:00
|
|
|
.It Fl R Fl -raw-guid
|
|
|
|
Do not substitute well known names for GUID numeric values in output.
|
2017-08-31 17:53:50 +00:00
|
|
|
.It Fl u Fl -utf8
|
|
|
|
Treat the value of the variable as UCS2 and convert it to UTF8 and
|
|
|
|
print the result.
|
2016-10-11 22:31:45 +00:00
|
|
|
.It Fl w Fl -write
|
2017-03-09 00:31:36 +00:00
|
|
|
Write (replace) the variable specified with the value specified from
|
|
|
|
standard input.
|
|
|
|
No command line option to do this is available since UEFI variables
|
|
|
|
are binary structures rather than strings.
|
|
|
|
.Xr echo 1
|
|
|
|
.Fl n
|
|
|
|
can be used to specify simple strings.
|
2016-10-11 22:31:45 +00:00
|
|
|
.It Ar name
|
|
|
|
Display the
|
|
|
|
.Ar name
|
|
|
|
environment variable.
|
2017-05-21 22:10:08 +00:00
|
|
|
.El
|
2016-10-11 22:31:45 +00:00
|
|
|
.Sh COMPATIBILITY
|
|
|
|
The
|
|
|
|
.Nm
|
2017-05-21 22:10:08 +00:00
|
|
|
program is intended to be compatible (strict superset) with a program
|
|
|
|
of the same name included in the Red Hat libefivar package,
|
|
|
|
but the
|
2017-03-09 00:31:36 +00:00
|
|
|
.Fl d
|
|
|
|
and
|
|
|
|
.Fl -print-decimal
|
2017-05-21 22:10:08 +00:00
|
|
|
flags are not implemented and never will be.
|
|
|
|
.Pp
|
2017-03-09 00:31:36 +00:00
|
|
|
The
|
|
|
|
.Fl d
|
2017-05-21 22:10:08 +00:00
|
|
|
flag is short for
|
2017-03-09 00:31:36 +00:00
|
|
|
.Fl -device-path .
|
2016-10-11 22:31:45 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
Appendix A of the UEFI specification has the format for GUIDs.
|
|
|
|
All GUIDs
|
|
|
|
.Dq Globally Unique Identifiers
|
|
|
|
have the format described in RFC 4122.
|
2017-03-09 00:31:36 +00:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility first appeared in
|
2017-05-22 13:55:59 +00:00
|
|
|
.Fx 11.1 .
|