mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-06-06 09:45:23 +00:00
Remove some unnecessary code.
Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
parent
35b0b55b3e
commit
2e7fc28d92
14
shim.c
14
shim.c
@ -905,8 +905,6 @@ should_use_fallback(EFI_HANDLE image_handle)
|
|||||||
{
|
{
|
||||||
EFI_GUID loaded_image_protocol = LOADED_IMAGE_PROTOCOL;
|
EFI_GUID loaded_image_protocol = LOADED_IMAGE_PROTOCOL;
|
||||||
EFI_LOADED_IMAGE *li;
|
EFI_LOADED_IMAGE *li;
|
||||||
EFI_DEVICE_PATH *devpath;
|
|
||||||
int i;
|
|
||||||
unsigned int pathlen = 0;
|
unsigned int pathlen = 0;
|
||||||
CHAR16 *bootpath;
|
CHAR16 *bootpath;
|
||||||
EFI_FILE_IO_INTERFACE *fio = NULL;
|
EFI_FILE_IO_INTERFACE *fio = NULL;
|
||||||
@ -919,9 +917,7 @@ should_use_fallback(EFI_HANDLE image_handle)
|
|||||||
if (EFI_ERROR(rc))
|
if (EFI_ERROR(rc))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
devpath = li->FilePath;
|
bootpath = DevicePathToStr(li->FilePath);
|
||||||
|
|
||||||
bootpath = DevicePathToStr(devpath);
|
|
||||||
|
|
||||||
/* Check the beginning of the string and the end, to avoid
|
/* Check the beginning of the string and the end, to avoid
|
||||||
* caring about which arch this is. */
|
* caring about which arch this is. */
|
||||||
@ -931,17 +927,11 @@ should_use_fallback(EFI_HANDLE image_handle)
|
|||||||
if (StrnCaseCmp(bootpath, L"\\EFI\\BOOT\\BOOT", 14) &&
|
if (StrnCaseCmp(bootpath, L"\\EFI\\BOOT\\BOOT", 14) &&
|
||||||
StrnCaseCmp(bootpath, L"\\EFI\\BOOT\\/BOOT", 15))
|
StrnCaseCmp(bootpath, L"\\EFI\\BOOT\\/BOOT", 15))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pathlen = StrLen(bootpath);
|
pathlen = StrLen(bootpath);
|
||||||
if (pathlen < 5 || StrCaseCmp(bootpath + pathlen - 4, L".EFI"))
|
if (pathlen < 5 || StrCaseCmp(bootpath + pathlen - 4, L".EFI"))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (i=pathlen; i>0; i--) {
|
|
||||||
if (bootpath[i] == '\\')
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
bootpath[i+1] = '\0';
|
|
||||||
|
|
||||||
rc = uefi_call_wrapper(BS->HandleProtocol, 3, li->DeviceHandle,
|
rc = uefi_call_wrapper(BS->HandleProtocol, 3, li->DeviceHandle,
|
||||||
&FileSystemProtocol, (void **)&fio);
|
&FileSystemProtocol, (void **)&fio);
|
||||||
if (EFI_ERROR(rc))
|
if (EFI_ERROR(rc))
|
||||||
|
Loading…
Reference in New Issue
Block a user