1.\" Copyright (c) 2003 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 September 29, 2016 28.Dt EFIVAR 8 29.Os 30.Sh NAME 31.Nm efivar 32.Nd UEFI environemnt variable interaction 33.Sh SYNOPSIS 34.Nm 35.Op Fl abdDHlLNpRtw 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 -fromfile Ar file 44.Op Fl -hex 45.Op Fl -list-guids 46.Op Fl -list 47.Op Fl -name Ar name 48.Op Fl -no-name 49.Op Fl -print 50.Op Fl -print-decimal 51.Op Fl -raw-guid 52.Op Fl -write 53.Ar name Ns Op = Ns Ar value 54.Sh DESCRIPTION 55This program manages 56.Dq Unified Extensible Firmware Interface 57.Pq UEFI 58environment variables. 59UEFI variables have three part: A namespace, a name and a value. 60The namespace is a GUID that's self assigned by the group defining the 61variables. 62The name is a Unicode name for the variable. 63The value is binary data. 64All Unicode data is presented to the user as UTF-8. 65.Pp 66The following options are available: 67.Bl -tag -width 20m 68.It Fl n Ar name Fl -name Ar name 69Specify the name of the variable to operate on. 70The 71.Ar name 72argument is the GUID of variable, followed by a dash, followed by the 73UEFI variable name. 74The GUID may be in numeric format, or may be one of the well known 75symbolic name (see 76.Fl -list-guids 77for a complete list). 78.It Fl f Ar file Fl -fromfile Ar file 79When writing or appending to a variable, take the data for the 80variable's value from 81.Ar file 82instead of from the command line. 83This flag implies 84.Fl -write 85unless the 86.Fl -append 87flag is given. 88This is not well understood and currently unimplemented. 89.It Fl a Fl -append 90Append the specified value to the UEFI variable rather than replacing 91it.p 92.It Fl t Ar attr Fl -attributes Ar attr 93Specify, in user hostile hexidecimal, the attributes for this 94variable. 95See section 7.2 (GetVariable subsection, Related Definitions) of the 96UEFI Specification for hex values to use. 97.It Fl A Fl -ascii 98Display the variable data as modified ascii: All printable characters 99are printed, while unprintable characters are rendered as a two-digit 100hexadecimal number preceeded by a % character. 101.It Fl b Fl -binary 102Display the variable data as binary data. 103Usually will be used with the 104.Fl N 105or 106.Fl -no-name 107flag. 108Useful in scripts. 109.It Fl D Fl -delete 110Delete the specified variable. 111May not be used with either the 112.Fl -write 113or the 114.Fl -append 115flags. 116No 117.Ar value 118may be specified. 119.It Fl H Fl -hex 120List variable data as a hex dump. 121.It Fl L Fl -list-guids 122Lists the well known GUIDs. 123The names listed here may be used in place of the numeric GUID values. 124These names will replace the numeric GUID values unless 125.Fl -raw-guid 126flag is specified. 127.It Fl l Fl -list 128List all the variables. 129If the 130.Fl -print 131flag is also listed, their values will be displayed. 132.It Fl N Fl -no-name 133Do not display the variable name. 134.It Fl p Fl -print 135Print the value of the variable. 136.It Fl d Fl -print-decimal 137Treat the value of the variable as a number and print it as a 138decimal. 139This is currently unimplemented. 140.It Fl R Fl -raw-guid 141Do not substitute well known names for GUID numeric values in output. 142.It Fl w Fl -write 143Write (replace) the variable specified with the value specified. 144.It Ar name 145Display the 146.Ar name 147environment variable. 148.It Ar name Ns = Ns Ar value 149Set the specified 150.Ar name 151to 152.Ar value . 153This is not yet implemented. 154.Sh COMPATIBILITY 155The 156.Nm 157program is intended to be compatible (strict superset) with a progam 158of the same name included in the Red Hat libefivar package. 159.Sh SEE ALSO 160Appendix A of the UEFI specification has the format for GUIDs. 161All GUIDs 162.Dq Globally Unique Identifiers 163have the format described in RFC 4122. 164.El 165