xref: /freebsd/usr.sbin/efivar/efivar.8 (revision 2f2f5c6728faaff4697e5cb7342c7240d0b4aec2)
1*2f2f5c67SWarner Losh.\" Copyright (c) 2017 Netflix, Inc
24b844f8dSWarner Losh.\" All rights reserved.
34b844f8dSWarner Losh.\"
44b844f8dSWarner Losh.\" Redistribution and use in source and binary forms, with or without
54b844f8dSWarner Losh.\" modification, are permitted provided that the following conditions
64b844f8dSWarner Losh.\" are met:
74b844f8dSWarner Losh.\" 1. Redistributions of source code must retain the above copyright
84b844f8dSWarner Losh.\"    notice, this list of conditions and the following disclaimer.
94b844f8dSWarner Losh.\" 2. Redistributions in binary form must reproduce the above copyright
104b844f8dSWarner Losh.\"    notice, this list of conditions and the following disclaimer in the
114b844f8dSWarner Losh.\"    documentation and/or other materials provided with the distribution.
124b844f8dSWarner Losh.\"
13b2a7ac48SWarner Losh.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
144b844f8dSWarner Losh.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
154b844f8dSWarner Losh.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16b2a7ac48SWarner Losh.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
174b844f8dSWarner Losh.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
184b844f8dSWarner Losh.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
194b844f8dSWarner Losh.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
204b844f8dSWarner Losh.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
214b844f8dSWarner Losh.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
224b844f8dSWarner Losh.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
234b844f8dSWarner Losh.\" SUCH DAMAGE.
244b844f8dSWarner Losh.\"
254b844f8dSWarner Losh.\" $FreeBSD$
264b844f8dSWarner Losh.\"
27*2f2f5c67SWarner Losh.Dd March 4, 2017
284b844f8dSWarner Losh.Dt EFIVAR 8
294b844f8dSWarner Losh.Os
304b844f8dSWarner Losh.Sh NAME
314b844f8dSWarner Losh.Nm efivar
324b844f8dSWarner Losh.Nd UEFI environemnt variable interaction
334b844f8dSWarner Losh.Sh SYNOPSIS
344b844f8dSWarner Losh.Nm
354b844f8dSWarner Losh.Op Fl abdDHlLNpRtw
364b844f8dSWarner Losh.Op Fl n Ar name
374b844f8dSWarner Losh.Op Fl f Ar file
384b844f8dSWarner Losh.Op Fl -append
394b844f8dSWarner Losh.Op Fl -ascii
404b844f8dSWarner Losh.Op Fl -attributes
414b844f8dSWarner Losh.Op Fl -binary
424b844f8dSWarner Losh.Op Fl -delete
43*2f2f5c67SWarner Losh.Op Fl -device-path
444b844f8dSWarner Losh.Op Fl -fromfile Ar file
4516445670SWarner Losh.Op Fl -guid
464b844f8dSWarner Losh.Op Fl -hex
474b844f8dSWarner Losh.Op Fl -list-guids
484b844f8dSWarner Losh.Op Fl -list
494b844f8dSWarner Losh.Op Fl -name Ar name
504b844f8dSWarner Losh.Op Fl -no-name
514b844f8dSWarner Losh.Op Fl -print
524b844f8dSWarner Losh.Op Fl -print-decimal
534b844f8dSWarner Losh.Op Fl -raw-guid
544b844f8dSWarner Losh.Op Fl -write
554b844f8dSWarner Losh.Sh DESCRIPTION
564b844f8dSWarner LoshThis program manages
574b844f8dSWarner Losh.Dq Unified Extensible Firmware Interface
584b844f8dSWarner Losh.Pq UEFI
594b844f8dSWarner Loshenvironment variables.
604b844f8dSWarner LoshUEFI variables have three part: A namespace, a name and a value.
614b844f8dSWarner LoshThe namespace is a GUID that's self assigned by the group defining the
624b844f8dSWarner Loshvariables.
634b844f8dSWarner LoshThe name is a Unicode name for the variable.
644b844f8dSWarner LoshThe value is binary data.
654b844f8dSWarner LoshAll Unicode data is presented to the user as UTF-8.
664b844f8dSWarner Losh.Pp
674b844f8dSWarner LoshThe following options are available:
684b844f8dSWarner Losh.Bl -tag -width 20m
694b844f8dSWarner Losh.It Fl n Ar name Fl -name Ar name
704b844f8dSWarner LoshSpecify the name of the variable to operate on.
714b844f8dSWarner LoshThe
724b844f8dSWarner Losh.Ar name
734b844f8dSWarner Loshargument is the GUID of variable, followed by a dash, followed by the
744b844f8dSWarner LoshUEFI variable name.
754b844f8dSWarner LoshThe GUID may be in numeric format, or may be one of the well known
764b844f8dSWarner Loshsymbolic name (see
774b844f8dSWarner Losh.Fl -list-guids
784b844f8dSWarner Loshfor a complete list).
794b844f8dSWarner Losh.It Fl f Ar file Fl -fromfile Ar file
804b844f8dSWarner LoshWhen writing or appending to a variable, take the data for the
814b844f8dSWarner Loshvariable's value from
824b844f8dSWarner Losh.Ar file
834b844f8dSWarner Loshinstead of from the command line.
844b844f8dSWarner LoshThis flag implies
854b844f8dSWarner Losh.Fl -write
864b844f8dSWarner Loshunless the
874b844f8dSWarner Losh.Fl -append
884b844f8dSWarner Loshflag is given.
894b844f8dSWarner LoshThis is not well understood and currently unimplemented.
904b844f8dSWarner Losh.It Fl a Fl -append
914b844f8dSWarner LoshAppend the specified value to the UEFI variable rather than replacing
924b844f8dSWarner Loshit.p
934b844f8dSWarner Losh.It Fl t Ar attr Fl -attributes Ar attr
944b844f8dSWarner LoshSpecify, in user hostile hexidecimal, the attributes for this
954b844f8dSWarner Loshvariable.
964b844f8dSWarner LoshSee section 7.2 (GetVariable subsection, Related Definitions) of the
974b844f8dSWarner LoshUEFI Specification for hex values to use.
984b844f8dSWarner Losh.It Fl A Fl -ascii
994b844f8dSWarner LoshDisplay the variable data as modified ascii: All printable characters
1004b844f8dSWarner Loshare printed, while unprintable characters are rendered as a two-digit
1014b844f8dSWarner Loshhexadecimal number preceeded by a % character.
1029013a3a0SWarner Losh.It Fl b Fl -binary
1034b844f8dSWarner LoshDisplay the variable data as binary data.
1044b844f8dSWarner LoshUsually will be used with the
1054b844f8dSWarner Losh.Fl N
1064b844f8dSWarner Loshor
1074b844f8dSWarner Losh.Fl -no-name
1084b844f8dSWarner Loshflag.
1094b844f8dSWarner LoshUseful in scripts.
1104b844f8dSWarner Losh.It Fl D Fl -delete
1114b844f8dSWarner LoshDelete the specified variable.
1124b844f8dSWarner LoshMay not be used with either the
1134b844f8dSWarner Losh.Fl -write
1144b844f8dSWarner Loshor the
1154b844f8dSWarner Losh.Fl -append
1164b844f8dSWarner Loshflags.
1174b844f8dSWarner LoshNo
1184b844f8dSWarner Losh.Ar value
1194b844f8dSWarner Loshmay be specified.
120*2f2f5c67SWarner Losh.It Fl d Fl -device Fl -device-path
121*2f2f5c67SWarner LoshInterpret the variables printed as UEFI device paths and print the
122*2f2f5c67SWarner LoshUEFI standard string representation.
12316445670SWarner Losh.It Fl g Fl -guid
12416445670SWarner Loshflag is specified, guids are converted to names if they are known (and
12516445670SWarner Loshshow up in
12616445670SWarner Losh.Fl -list-guids ).
1274b844f8dSWarner Losh.It Fl H Fl -hex
1284b844f8dSWarner LoshList variable data as a hex dump.
1294b844f8dSWarner Losh.It Fl L Fl -list-guids
1304b844f8dSWarner LoshLists the well known GUIDs.
1314b844f8dSWarner LoshThe names listed here may be used in place of the numeric GUID values.
1324b844f8dSWarner LoshThese names will replace the numeric GUID values unless
1334b844f8dSWarner Losh.Fl -raw-guid
1344b844f8dSWarner Loshflag is specified.
1354b844f8dSWarner Losh.It Fl l Fl -list
1364b844f8dSWarner LoshList all the variables.
1374b844f8dSWarner LoshIf the
1384b844f8dSWarner Losh.Fl -print
1394b844f8dSWarner Loshflag is also listed, their values will be displayed.
1404b844f8dSWarner Losh.It Fl N Fl -no-name
1414b844f8dSWarner LoshDo not display the variable name.
1424b844f8dSWarner Losh.It Fl p Fl -print
1434b844f8dSWarner LoshPrint the value of the variable.
1444b844f8dSWarner Losh.It Fl R Fl -raw-guid
1454b844f8dSWarner LoshDo not substitute well known names for GUID numeric values in output.
1464b844f8dSWarner Losh.It Fl w Fl -write
147*2f2f5c67SWarner LoshWrite (replace) the variable specified with the value specified from
148*2f2f5c67SWarner Loshstandard input.
149*2f2f5c67SWarner LoshNo command line option to do this is available since UEFI variables
150*2f2f5c67SWarner Loshare binary structures rather than strings.
151*2f2f5c67SWarner Losh.Xr echo 1
152*2f2f5c67SWarner Losh.Fl n
153*2f2f5c67SWarner Loshcan be used to specify simple strings.
1544b844f8dSWarner Losh.It Ar name
1554b844f8dSWarner LoshDisplay the
1564b844f8dSWarner Losh.Ar name
1574b844f8dSWarner Loshenvironment variable.
1584b844f8dSWarner Losh.Sh COMPATIBILITY
1594b844f8dSWarner LoshThe
1604b844f8dSWarner Losh.Nm
1614b844f8dSWarner Loshprogram is intended to be compatible (strict superset) with a progam
1624b844f8dSWarner Loshof the same name included in the Red Hat libefivar package.
163*2f2f5c67SWarner Losh.Pp
164*2f2f5c67SWarner LoshExcept the
165*2f2f5c67SWarner Losh.Fl d
166*2f2f5c67SWarner Loshand
167*2f2f5c67SWarner Losh.Fl -print-decimal
168*2f2f5c67SWarner Loshflags are not implmenented and never will be.
169*2f2f5c67SWarner LoshThe
170*2f2f5c67SWarner Losh.Fl d
171*2f2f5c67SWarner Loshflag is a short-hand for
172*2f2f5c67SWarner Losh.Fl -device-path .
1734b844f8dSWarner Losh.Sh SEE ALSO
1744b844f8dSWarner LoshAppendix A of the UEFI specification has the format for GUIDs.
1754b844f8dSWarner LoshAll GUIDs
1764b844f8dSWarner Losh.Dq Globally Unique Identifiers
1774b844f8dSWarner Loshhave the format described in RFC 4122.
1784b844f8dSWarner Losh.El
179*2f2f5c67SWarner Losh.Pp
180*2f2f5c67SWarner Losh.Xr efivar 8
181*2f2f5c67SWarner Losh.Sh HISTORY
182*2f2f5c67SWarner LoshThe
183*2f2f5c67SWarner Losh.Nm
184*2f2f5c67SWarner Loshutility first appeared in
185*2f2f5c67SWarner Losh.Fx 12.0 .
186