summaryrefslogtreecommitdiff
path: root/shim.c
diff options
context:
space:
mode:
authorIvan Hu <ivan.hu@canonical.com>2016-05-10 13:53:24 +0800
committerPeter Jones <pjones@redhat.com>2016-05-11 11:10:17 -0400
commit085d56c46423732b841d092f02c94ca63e2f6f1e (patch)
tree1f0117c67e4061abd2cfafeb6d1ccfcc44000a58 /shim.c
parent8f1bd605d05077a76502de5510cc937c4f4c62dd (diff)
downloadefi-boot-shim-085d56c46423732b841d092f02c94ca63e2f6f1e.tar.gz
efi-boot-shim-085d56c46423732b841d092f02c94ca63e2f6f1e.zip
shim: dealing with only one string on loadoption
The second stage set is not working after commit 3322257e611e2000f79726d295bb4845bbe449e7 for those which load option only have one string. Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
Diffstat (limited to 'shim.c')
-rw-r--r--shim.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/shim.c b/shim.c
index f7841dee..b72b4bdf 100644
--- a/shim.c
+++ b/shim.c
@@ -2168,6 +2168,18 @@ EFI_STATUS set_second_stage (EFI_HANDLE image_handle)
*
* which is clearly an EFI_LOAD_OPTION filled in halfway reasonably.
* In short, the UEFI shell is still a useless piece of junk.
+ *
+ * But then on some versions of BDS, we get:
+
+00000000 5c 00 66 00 77 00 75 00 70 00 78 00 36 00 34 00 |\.f.w.u.p.x.6.4.|
+00000010 2e 00 65 00 66 00 69 00 00 00 |..e.f.i...|
+0000001a
+
+ * which as you can see is one perfectly normal UCS2-EL string
+ * containing the load option from the Boot#### variable.
+ *
+ * We also sometimes find a guid or partial guid at the end, because
+ * BDS will add that, but we ignore that here.
*/
/*
@@ -2252,6 +2264,10 @@ EFI_STATUS set_second_stage (EFI_HANDLE image_handle)
}
if (loader_len)
remaining_size -= loader_len;
+ } else {
+ /* only find one string */
+ start = li->LoadOptions;
+ loader_len = li->LoadOptionsSize;
}
/*