summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/systemd-boot/systemd-boot/0005-sd-boot-support-global-kernel-command-line-in-EFI-st.patch
diff options
context:
space:
mode:
authorCalifornia Sullivan <california.l.sullivan@intel.com>2018-03-20 16:21:33 -0700
committerCalifornia Sullivan <california.l.sullivan@intel.com>2018-03-22 08:29:39 -0700
commitf2502f90ab3decc5c3faf38ecfd13ac3bce4f411 (patch)
tree15d27e6e8eadf743f5a7d6f25dc44577e284160d /recipes-bsp/systemd-boot/systemd-boot/0005-sd-boot-support-global-kernel-command-line-in-EFI-st.patch
parent90d32d53cf2d0d7b0edc5e8eab734f620fb8c3ec (diff)
downloadmeta-intel-f2502f90ab3decc5c3faf38ecfd13ac3bce4f411.tar.gz
systemd-boot/rmc-boot.inc: update to work with v237 and meson
Patch changes: * 0001-sd-boot-Link-RMC-library-into-bootloader-and-stub.patch removed because make is no longer used. * 0001-sd-boot-stub-check-LoadOptions-contains-data.patch removed because it was accepted upstream. * 0001-partially-revert-sd-boot-stub-Obtain-PE-section-offs.patch added to support RMC functionality. Upstream removed a snippet that found the root directory because they didn't need it anymore, but RMC does. * 0002-sd-boot-fix-RMC-compatibility-with-systemd-boot-and-.patch added to support building with meson instead of make. * Others refreshed inc file changes: * Don't commit pin, we can maintain these patches OK for now * EXTRA_OEMAKE -> EXTRA_OEMESON, and removed some superfluous options Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Diffstat (limited to 'recipes-bsp/systemd-boot/systemd-boot/0005-sd-boot-support-global-kernel-command-line-in-EFI-st.patch')
-rw-r--r--recipes-bsp/systemd-boot/systemd-boot/0005-sd-boot-support-global-kernel-command-line-in-EFI-st.patch82
1 files changed, 82 insertions, 0 deletions
diff --git a/recipes-bsp/systemd-boot/systemd-boot/0005-sd-boot-support-global-kernel-command-line-in-EFI-st.patch b/recipes-bsp/systemd-boot/systemd-boot/0005-sd-boot-support-global-kernel-command-line-in-EFI-st.patch
new file mode 100644
index 00000000..60e93ca8
--- /dev/null
+++ b/recipes-bsp/systemd-boot/systemd-boot/0005-sd-boot-support-global-kernel-command-line-in-EFI-st.patch
@@ -0,0 +1,82 @@
1From 405a77233dde990fa7815d1546dc5a6b5a608479 Mon Sep 17 00:00:00 2001
2From: Mikko Ylinen <mikko.ylinen@intel.com>
3Date: Fri, 27 Jan 2017 13:31:45 +0200
4Subject: [PATCH 5/5] sd-boot: support global kernel command line in EFI stub
5
6This change integrates rmc into EFI stub and supports a
7global fragment (RMC KBOOTPARAM) that is appended to the
8cmdline at boot.
9
10The fragment is board-specific and read from the database.
11
12Implements [YOCTO #10924].
13
14Upstream-status: Pending
15
16Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
17Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
18---
19 src/boot/efi/stub.c | 33 +++++++++++++++++++++++++++++++++
20 1 file changed, 33 insertions(+)
21
22diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c
23index 540ca5985..11047477b 100644
24--- a/src/boot/efi/stub.c
25+++ b/src/boot/efi/stub.c
26@@ -14,6 +14,7 @@
27
28 #include <efi.h>
29 #include <efilib.h>
30+#include <rmc_api.h>
31
32 #include "disk.h"
33 #include "graphics.h"
34@@ -49,6 +50,9 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
35 UINTN cmdline_len;
36 CHAR16 uuid[37];
37 EFI_STATUS err;
38+ INTN len;
39+ CHAR8 *rmc_db = NULL;
40+ rmc_file_t rmc_file;
41
42 InitializeLib(image, sys_table);
43
44@@ -109,6 +113,35 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
45 #endif
46 }
47
48+ len = file_read(root_dir, L"\\rmc.db", 0, 0, &rmc_db);
49+ if (len <= 0)
50+ rmc_db = NULL;
51+
52+ /* If the board has a fragment in rmc database, append it to the cmdline */
53+ if (rmc_db && !rmc_gimme_file(sys_table, rmc_db, "KBOOTPARAM", &rmc_file)) {
54+ CHAR8 *line;
55+ UINTN i = 0;
56+ UINTN j;
57+
58+ line = AllocatePool(rmc_file.blob_len + cmdline_len + 2);
59+
60+ while (i < cmdline_len && cmdline[i] != '\0') {
61+ line[i] = cmdline[i];
62+ i++;
63+ }
64+
65+ line[i++] = ' ';
66+
67+ for (j=0; j < rmc_file.blob_len; j++)
68+ line[i+j] = rmc_file.blob[j];
69+ line[i+j] = '\0';
70+
71+ cmdline = line;
72+ cmdline_len = i + j;
73+
74+ FreePool(rmc_db);
75+ }
76+
77 /* export the device path this image is started from */
78 if (disk_get_part_uuid(loaded_image->DeviceHandle, uuid) == EFI_SUCCESS)
79 efivar_set(L"LoaderDevicePartUUID", uuid, FALSE);
80--
812.14.3
82