summaryrefslogtreecommitdiff
path: root/shim.c
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2013-04-26 11:31:40 -0400
committerPeter Jones <pjones@redhat.com>2013-04-26 11:44:15 -0400
commit2cead91ea22bd65a8560f41bcdaa0a8569f524fe (patch)
tree57f44123fe8aaf2a199d94d63d084baf068f13b9 /shim.c
parent4bab48ce880964b3ee709b5acd565160dbf9ff19 (diff)
downloadefi-boot-shim-2cead91ea22bd65a8560f41bcdaa0a8569f524fe.tar.gz
efi-boot-shim-2cead91ea22bd65a8560f41bcdaa0a8569f524fe.zip
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 <pjones@redhat.com>
Diffstat (limited to 'shim.c')
-rw-r--r--shim.c7
1 files changed, 6 insertions, 1 deletions
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;