mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-08-15 10:21:21 +00:00
MokManager: Try APPEND_WRITE first
Try to append the MOK/MOKX list first and then fallback to the normal SetVariable if the firmware doesn't support EFI_VARIABLE_APPEND_WRITE. Signed-off-by: Gary Lin <glin@suse.com>
This commit is contained in:
parent
5597a493e2
commit
e21068b499
10
MokManager.c
10
MokManager.c
@ -872,6 +872,16 @@ static EFI_STATUS write_db (CHAR16 *db_name, void *MokNew, UINTN MokNewSize)
|
|||||||
UINTN old_size;
|
UINTN old_size;
|
||||||
UINTN new_size;
|
UINTN new_size;
|
||||||
|
|
||||||
|
status = uefi_call_wrapper(RT->SetVariable, 5, db_name,
|
||||||
|
&shim_lock_guid,
|
||||||
|
EFI_VARIABLE_NON_VOLATILE
|
||||||
|
| EFI_VARIABLE_BOOTSERVICE_ACCESS
|
||||||
|
| EFI_VARIABLE_APPEND_WRITE,
|
||||||
|
MokNewSize, MokNew);
|
||||||
|
if (status == EFI_SUCCESS || status != EFI_INVALID_PARAMETER) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
status = get_variable_attr(db_name, (UINT8 **)&old_data, &old_size,
|
status = get_variable_attr(db_name, (UINT8 **)&old_data, &old_size,
|
||||||
shim_lock_guid, &attributes);
|
shim_lock_guid, &attributes);
|
||||||
if (EFI_ERROR(status) && status != EFI_NOT_FOUND) {
|
if (EFI_ERROR(status) && status != EFI_NOT_FOUND) {
|
||||||
|
Loading…
Reference in New Issue
Block a user