Skip to content

Commit

Permalink
Hack to avoid sourcing shim.c when running unit tests
Browse files Browse the repository at this point in the history
Required because is_removable_media_path() is implemented in shim.c but
shim.c cannot be sourced for unit tests because of dependencies on
openssl files.

Signed-off-by: Renaud Métrich <[email protected]>
  • Loading branch information
rmetrich committed Jun 4, 2024
1 parent a0695a8 commit 44b71e5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mok.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ static EFI_STATUS check_mok_request(EFI_HANDLE image_handle)
efi_status = start_image(image_handle, MOK_MANAGER);

if (EFI_ERROR(efi_status)) {
#ifndef SHIM_UNIT_TEST
EFI_STATUS efi_status_2;
EFI_LOADED_IMAGE *li;
efi_status_2 = BS->HandleProtocol(image_handle, &EFI_LOADED_IMAGE_GUID,
Expand All @@ -70,6 +71,7 @@ static EFI_STATUS check_mok_request(EFI_HANDLE image_handle)
console_countdown(title, message, 10);
RT->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, NULL);
}
#endif
perror(L"Failed to start MokManager: %r\n", efi_status);
return efi_status;
}
Expand Down

0 comments on commit 44b71e5

Please sign in to comment.