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