summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/systemd-boot/systemd-boot/0001-partially-revert-sd-boot-stub-Obtain-PE-section-offs.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp/systemd-boot/systemd-boot/0001-partially-revert-sd-boot-stub-Obtain-PE-section-offs.patch')
-rw-r--r--recipes-bsp/systemd-boot/systemd-boot/0001-partially-revert-sd-boot-stub-Obtain-PE-section-offs.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/recipes-bsp/systemd-boot/systemd-boot/0001-partially-revert-sd-boot-stub-Obtain-PE-section-offs.patch b/recipes-bsp/systemd-boot/systemd-boot/0001-partially-revert-sd-boot-stub-Obtain-PE-section-offs.patch
new file mode 100644
index 00000000..6d7b144d
--- /dev/null
+++ b/recipes-bsp/systemd-boot/systemd-boot/0001-partially-revert-sd-boot-stub-Obtain-PE-section-offs.patch
@@ -0,0 +1,46 @@
1From beb095f41d458b7d684c0cd6cac1749e2fc3f29b Mon Sep 17 00:00:00 2001
2From: California Sullivan <california.l.sullivan@intel.com>
3Date: Wed, 21 Mar 2018 13:01:26 -0700
4Subject: [PATCH 1/5] partially revert "sd-boot: stub: Obtain PE section
5 offsets from RAM, not disk (#6250)"
6
7Only revert the section for finding the root_dir, as RMC needs this to
8find its database file.
9
10Upstream-Status: Inappropriate [upstream doesn't need the root_dir].
11
12Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
13---
14 src/boot/efi/stub.c | 9 +++++++++
15 1 file changed, 9 insertions(+)
16
17diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c
18index ff45cebd4..540ca5985 100644
19--- a/src/boot/efi/stub.c
20+++ b/src/boot/efi/stub.c
21@@ -30,6 +30,8 @@ static const EFI_GUID global_guid = EFI_GLOBAL_VARIABLE;
22
23 EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
24 EFI_LOADED_IMAGE *loaded_image;
25+ EFI_FILE *root_dir;
26+ CHAR16 *loaded_image_path;
27 CHAR8 *b;
28 UINTN size;
29 BOOLEAN secure = FALSE;
30@@ -58,6 +60,13 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
31 return err;
32 }
33
34+ root_dir = LibOpenRoot(loaded_image->DeviceHandle);
35+ if (!root_dir) {
36+ Print(L"Unable to open root directory: %r ", err);
37+ uefi_call_wrapper(BS->Stall, 1, 3 * 1000 * 1000);
38+ return EFI_LOAD_ERROR;
39+ }
40+
41 if (efivar_get_raw(&global_guid, L"SecureBoot", &b, &size) == EFI_SUCCESS) {
42 if (*b > 0)
43 secure = TRUE;
44--
452.14.3
46