xref: /OK3568_Linux_fs/kernel/Documentation/ABI/stable/sysfs-firmware-efi-vars (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunWhat:		/sys/firmware/efi/vars
2*4882a593SmuzhiyunDate:		April 2004
3*4882a593SmuzhiyunContact:	Matt Domsch <Matt_Domsch@dell.com>
4*4882a593SmuzhiyunDescription:
5*4882a593Smuzhiyun		This directory exposes interfaces for interactive with
6*4882a593Smuzhiyun		EFI variables.  For more information on EFI variables,
7*4882a593Smuzhiyun		see 'Variable Services' in the UEFI specification
8*4882a593Smuzhiyun		(section 7.2 in specification version 2.3 Errata D).
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun		In summary, EFI variables are named, and are classified
11*4882a593Smuzhiyun		into separate namespaces through the use of a vendor
12*4882a593Smuzhiyun		GUID.  They also have an arbitrary binary value
13*4882a593Smuzhiyun		associated with them.
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun		The efivars module enumerates these variables and
16*4882a593Smuzhiyun		creates a separate directory for each one found.  Each
17*4882a593Smuzhiyun		directory has a name of the form "<key>-<vendor guid>"
18*4882a593Smuzhiyun		and contains the following files:
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun		=============== ========================================
21*4882a593Smuzhiyun		attributes:	A read-only text file enumerating the
22*4882a593Smuzhiyun				EFI variable flags.  Potential values
23*4882a593Smuzhiyun				include:
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun				EFI_VARIABLE_NON_VOLATILE
26*4882a593Smuzhiyun				EFI_VARIABLE_BOOTSERVICE_ACCESS
27*4882a593Smuzhiyun				EFI_VARIABLE_RUNTIME_ACCESS
28*4882a593Smuzhiyun				EFI_VARIABLE_HARDWARE_ERROR_RECORD
29*4882a593Smuzhiyun				EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun				See the EFI documentation for an
32*4882a593Smuzhiyun				explanation of each of these variables.
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun		data:		A read-only binary file that can be read
35*4882a593Smuzhiyun				to attain the value of the EFI variable
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun		guid:		The vendor GUID of the variable.  This
38*4882a593Smuzhiyun				should always match the GUID in the
39*4882a593Smuzhiyun				variable's name.
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun		raw_var:	A binary file that can be read to obtain
42*4882a593Smuzhiyun				a structure that contains everything
43*4882a593Smuzhiyun				there is to know about the variable.
44*4882a593Smuzhiyun				For structure definition see "struct
45*4882a593Smuzhiyun				efi_variable" in the kernel sources.
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun				This file can also be written to in
48*4882a593Smuzhiyun				order to update the value of a variable.
49*4882a593Smuzhiyun				For this to work however, all fields of
50*4882a593Smuzhiyun				the "struct efi_variable" passed must
51*4882a593Smuzhiyun				match byte for byte with the structure
52*4882a593Smuzhiyun				read out of the file, save for the value
53*4882a593Smuzhiyun				portion.
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun				**Note** the efi_variable structure
56*4882a593Smuzhiyun				read/written with this file contains a
57*4882a593Smuzhiyun				'long' type that may change widths
58*4882a593Smuzhiyun				depending on your underlying
59*4882a593Smuzhiyun				architecture.
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun		size:		As ASCII representation of the size of
62*4882a593Smuzhiyun				the variable's value.
63*4882a593Smuzhiyun		=============== ========================================
64*4882a593Smuzhiyun
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun		In addition, two other magic binary files are provided
67*4882a593Smuzhiyun		in the top-level directory and are used for adding and
68*4882a593Smuzhiyun		removing variables:
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun		=============== ========================================
71*4882a593Smuzhiyun		new_var:	Takes a "struct efi_variable" and
72*4882a593Smuzhiyun				instructs the EFI firmware to create a
73*4882a593Smuzhiyun				new variable.
74*4882a593Smuzhiyun
75*4882a593Smuzhiyun		del_var:	Takes a "struct efi_variable" and
76*4882a593Smuzhiyun				instructs the EFI firmware to remove any
77*4882a593Smuzhiyun				variable that has a matching vendor GUID
78*4882a593Smuzhiyun				and variable key name.
79*4882a593Smuzhiyun		=============== ========================================
80