18c2ecf20Sopenharmony_ciWhat: /sys/firmware/efi/vars 28c2ecf20Sopenharmony_ciDate: April 2004 38c2ecf20Sopenharmony_ciContact: Matt Domsch <Matt_Domsch@dell.com> 48c2ecf20Sopenharmony_ciDescription: 58c2ecf20Sopenharmony_ci This directory exposes interfaces for interactive with 68c2ecf20Sopenharmony_ci EFI variables. For more information on EFI variables, 78c2ecf20Sopenharmony_ci see 'Variable Services' in the UEFI specification 88c2ecf20Sopenharmony_ci (section 7.2 in specification version 2.3 Errata D). 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci In summary, EFI variables are named, and are classified 118c2ecf20Sopenharmony_ci into separate namespaces through the use of a vendor 128c2ecf20Sopenharmony_ci GUID. They also have an arbitrary binary value 138c2ecf20Sopenharmony_ci associated with them. 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci The efivars module enumerates these variables and 168c2ecf20Sopenharmony_ci creates a separate directory for each one found. Each 178c2ecf20Sopenharmony_ci directory has a name of the form "<key>-<vendor guid>" 188c2ecf20Sopenharmony_ci and contains the following files: 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci =============== ======================================== 218c2ecf20Sopenharmony_ci attributes: A read-only text file enumerating the 228c2ecf20Sopenharmony_ci EFI variable flags. Potential values 238c2ecf20Sopenharmony_ci include: 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci EFI_VARIABLE_NON_VOLATILE 268c2ecf20Sopenharmony_ci EFI_VARIABLE_BOOTSERVICE_ACCESS 278c2ecf20Sopenharmony_ci EFI_VARIABLE_RUNTIME_ACCESS 288c2ecf20Sopenharmony_ci EFI_VARIABLE_HARDWARE_ERROR_RECORD 298c2ecf20Sopenharmony_ci EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci See the EFI documentation for an 328c2ecf20Sopenharmony_ci explanation of each of these variables. 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci data: A read-only binary file that can be read 358c2ecf20Sopenharmony_ci to attain the value of the EFI variable 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci guid: The vendor GUID of the variable. This 388c2ecf20Sopenharmony_ci should always match the GUID in the 398c2ecf20Sopenharmony_ci variable's name. 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci raw_var: A binary file that can be read to obtain 428c2ecf20Sopenharmony_ci a structure that contains everything 438c2ecf20Sopenharmony_ci there is to know about the variable. 448c2ecf20Sopenharmony_ci For structure definition see "struct 458c2ecf20Sopenharmony_ci efi_variable" in the kernel sources. 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ci This file can also be written to in 488c2ecf20Sopenharmony_ci order to update the value of a variable. 498c2ecf20Sopenharmony_ci For this to work however, all fields of 508c2ecf20Sopenharmony_ci the "struct efi_variable" passed must 518c2ecf20Sopenharmony_ci match byte for byte with the structure 528c2ecf20Sopenharmony_ci read out of the file, save for the value 538c2ecf20Sopenharmony_ci portion. 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci **Note** the efi_variable structure 568c2ecf20Sopenharmony_ci read/written with this file contains a 578c2ecf20Sopenharmony_ci 'long' type that may change widths 588c2ecf20Sopenharmony_ci depending on your underlying 598c2ecf20Sopenharmony_ci architecture. 608c2ecf20Sopenharmony_ci 618c2ecf20Sopenharmony_ci size: As ASCII representation of the size of 628c2ecf20Sopenharmony_ci the variable's value. 638c2ecf20Sopenharmony_ci =============== ======================================== 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ci In addition, two other magic binary files are provided 678c2ecf20Sopenharmony_ci in the top-level directory and are used for adding and 688c2ecf20Sopenharmony_ci removing variables: 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_ci =============== ======================================== 718c2ecf20Sopenharmony_ci new_var: Takes a "struct efi_variable" and 728c2ecf20Sopenharmony_ci instructs the EFI firmware to create a 738c2ecf20Sopenharmony_ci new variable. 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ci del_var: Takes a "struct efi_variable" and 768c2ecf20Sopenharmony_ci instructs the EFI firmware to remove any 778c2ecf20Sopenharmony_ci variable that has a matching vendor GUID 788c2ecf20Sopenharmony_ci and variable key name. 798c2ecf20Sopenharmony_ci =============== ======================================== 80