summaryrefslogtreecommitdiff
path: root/include/efi_variable.h
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2026-04-06 12:16:57 -0600
committerTom Rini <[email protected]>2026-04-06 12:16:57 -0600
commit93f84ee022a8401421cdaab84fe7d106d83fdb4a (patch)
treefb15a4af876e8faf9893fd86c1c0e127265dbe9a /include/efi_variable.h
parent88dc2788777babfd6322fa655df549a019aa1e69 (diff)
parente2138cf1e6088f12ffa874e87cc8f4b198378635 (diff)
Merge branch 'next'
Diffstat (limited to 'include/efi_variable.h')
-rw-r--r--include/efi_variable.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/include/efi_variable.h b/include/efi_variable.h
index 4065cf45eca..c3229c717d8 100644
--- a/include/efi_variable.h
+++ b/include/efi_variable.h
@@ -137,13 +137,11 @@ struct efi_var_file {
};
/**
- * efi_var_to_file() - save non-volatile variables as file
- *
- * File ubootefi.var is created on the EFI system partion.
+ * efi_var_to_storage() - save non-volatile variables
*
* Return: status code
*/
-efi_status_t efi_var_to_file(void);
+efi_status_t efi_var_to_storage(void);
/**
* efi_var_collect() - collect variables in buffer
@@ -161,6 +159,11 @@ efi_status_t efi_var_to_file(void);
efi_status_t __maybe_unused efi_var_collect(struct efi_var_file **bufp, loff_t *lenp,
u32 check_attr_mask);
+/* GUID used by Shim to store the MOK database */
+#define SHIM_LOCK_GUID \
+ EFI_GUID(0x605dab50, 0xe046, 0x4300, \
+ 0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23)
+
/**
* efi_var_restore() - restore EFI variables from buffer
*
@@ -173,17 +176,14 @@ efi_status_t __maybe_unused efi_var_collect(struct efi_var_file **bufp, loff_t *
efi_status_t efi_var_restore(struct efi_var_file *buf, bool safe);
/**
- * efi_var_from_file() - read variables from file
- *
- * File ubootefi.var is read from the EFI system partitions and the variables
- * stored in the file are created.
+ * efi_var_from_storage() - read variables
*
* In case the file does not exist yet or a variable cannot be set EFI_SUCCESS
* is returned.
*
* Return: status code
*/
-efi_status_t efi_var_from_file(void);
+efi_status_t efi_var_from_storage(void);
/**
* efi_var_mem_init() - set-up variable list
@@ -216,6 +216,11 @@ void efi_var_mem_del(struct efi_var_entry *var);
* The variable is appended without checking if a variable of the same name
* already exists. The two data buffers are concatenated.
*
+ * When @changep is non-NULL and @size2 is 0, the function compares the new
+ * value against an existing variable with the same name and vendor. If
+ * attributes and data are identical the insertion is skipped and *@changep
+ * is set to false, avoiding superfluous writes.
+ *
* @variable_name: variable name
* @vendor: GUID
* @attributes: variable attributes
@@ -224,13 +229,14 @@ void efi_var_mem_del(struct efi_var_entry *var);
* @size2: size of the second data field
* @data2: second data buffer
* @time: time of authentication (as seconds since start of epoch)
+ * @changep: pointer to change flag (may be NULL)
* Result: status code
*/
efi_status_t efi_var_mem_ins(const u16 *variable_name,
const efi_guid_t *vendor, u32 attributes,
const efi_uintn_t size1, const void *data1,
const efi_uintn_t size2, const void *data2,
- const u64 time);
+ const u64 time, bool *changep);
/**
* efi_var_mem_free() - determine free memory for variables