diff options
| author | Shantur Rathore <[email protected]> | 2026-02-11 16:56:20 +0100 |
|---|---|---|
| committer | Heinrich Schuchardt <[email protected]> | 2026-02-15 09:14:31 +0100 |
| commit | 38ea3bfc6506174c3ae219b33171db2c2098afd1 (patch) | |
| tree | ce3a0a12a8efdaf5ec35331753f3f7cba7e7e642 /lib/efi_loader/efi_variable.c | |
| parent | fd2d98687614c4ce8b649021a5df30bc9688bda3 (diff) | |
efi_var_file: refactor to move buffer functions
Currently efi_var_file.c has functions to store/read
EFI variables to/from memory buffer. These functions
can be used with other EFI variable stores so move
them out to efi_var_common.c
Signed-off-by: Shantur Rathore <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
Tested-by: Neil Armstrong <[email protected]> # on AML-S905D3-CC
Reviewed-by: Ilias Apalodimas <[email protected]>
Reviewed-by: Heinrich Schuchardt <[email protected]>
Diffstat (limited to 'lib/efi_loader/efi_variable.c')
| -rw-r--r-- | lib/efi_loader/efi_variable.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c index f3533f4def3..6e45134c61b 100644 --- a/lib/efi_loader/efi_variable.c +++ b/lib/efi_loader/efi_variable.c @@ -397,11 +397,15 @@ efi_status_t efi_set_variable_int(const u16 *variable_name, ret = EFI_SUCCESS; /* - * Write non-volatile EFI variables to file + * Write non-volatile EFI variables * TODO: check if a value change has occured to avoid superfluous writes */ - if (attributes & EFI_VARIABLE_NON_VOLATILE) + if (attributes & EFI_VARIABLE_NON_VOLATILE) { + if (IS_ENABLED(CONFIG_EFI_VARIABLE_NO_STORE)) + return EFI_SUCCESS; + efi_var_to_file(); + } return EFI_SUCCESS; } @@ -594,9 +598,12 @@ efi_status_t efi_init_variables(void) if (ret != EFI_SUCCESS) return ret; - ret = efi_var_from_file(); - if (ret != EFI_SUCCESS) - return ret; + if (!IS_ENABLED(CONFIG_EFI_VARIABLE_NO_STORE)) { + ret = efi_var_from_file(); + if (ret != EFI_SUCCESS) + return ret; + } + if (IS_ENABLED(CONFIG_EFI_VARIABLES_PRESEED)) { ret = efi_var_restore((struct efi_var_file *) __efi_var_file_begin, true); |
