From 6e1bd3dcb70985e81f1f9d133219b708eb9beddd Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 26 Apr 2013 11:44:15 -0400 Subject: UEFI Shell sticks the UCS2 of li->FilePath in li->LoadOptions. Ignore it. If li->LoadOptions tells us to execute our own binary, it's clearly not what we want to do for the second stage. So simply ignore that case. Signed-off-by: Peter Jones --- shim.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'shim.c') diff --git a/shim.c b/shim.c index dcf1c516..32b3ae95 100644 --- a/shim.c +++ b/shim.c @@ -41,6 +41,7 @@ #include "signature.h" #include "netboot.h" #include "shim_cert.h" +#include "ucs2.h" #define DEFAULT_LOADER L"\\grub.efi" #define MOK_MANAGER L"\\MokManager.efi" @@ -1328,6 +1329,7 @@ EFI_STATUS set_second_stage (EFI_HANDLE image_handle) { EFI_STATUS status; EFI_LOADED_IMAGE *li; + CHAR16 *bootpath = NULL; CHAR16 *start = NULL, *c; int i, remaining_size = 0; @@ -1361,7 +1363,10 @@ EFI_STATUS set_second_stage (EFI_HANDLE image_handle) } } - second_stage = (CHAR16 *)li->LoadOptions; + bootpath = DevicePathToStr(li->FilePath); + if (!StrCaseCmp(bootpath, (CHAR16 *)li->LoadOptions)) + second_stage = (CHAR16 *)li->LoadOptions; + if (start && remaining_size > 0) { load_options = start; load_options_size = remaining_size; -- cgit v1.2.3