From f2502f90ab3decc5c3faf38ecfd13ac3bce4f411 Mon Sep 17 00:00:00 2001 From: California Sullivan Date: Tue, 20 Mar 2018 16:21:33 -0700 Subject: 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 --- ...port-global-kernel-command-line-in-EFI-st.patch | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 recipes-bsp/systemd-boot/systemd-boot/0005-sd-boot-support-global-kernel-command-line-in-EFI-st.patch (limited to 'recipes-bsp/systemd-boot/systemd-boot/0005-sd-boot-support-global-kernel-command-line-in-EFI-st.patch') 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 @@ +From 405a77233dde990fa7815d1546dc5a6b5a608479 Mon Sep 17 00:00:00 2001 +From: Mikko Ylinen +Date: Fri, 27 Jan 2017 13:31:45 +0200 +Subject: [PATCH 5/5] sd-boot: support global kernel command line in EFI stub + +This change integrates rmc into EFI stub and supports a +global fragment (RMC KBOOTPARAM) that is appended to the +cmdline at boot. + +The fragment is board-specific and read from the database. + +Implements [YOCTO #10924]. + +Upstream-status: Pending + +Signed-off-by: Mikko Ylinen +Signed-off-by: California Sullivan +--- + src/boot/efi/stub.c | 33 +++++++++++++++++++++++++++++++++ + 1 file changed, 33 insertions(+) + +diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c +index 540ca5985..11047477b 100644 +--- a/src/boot/efi/stub.c ++++ b/src/boot/efi/stub.c +@@ -14,6 +14,7 @@ + + #include + #include ++#include + + #include "disk.h" + #include "graphics.h" +@@ -49,6 +50,9 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { + UINTN cmdline_len; + CHAR16 uuid[37]; + EFI_STATUS err; ++ INTN len; ++ CHAR8 *rmc_db = NULL; ++ rmc_file_t rmc_file; + + InitializeLib(image, sys_table); + +@@ -109,6 +113,35 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { + #endif + } + ++ len = file_read(root_dir, L"\\rmc.db", 0, 0, &rmc_db); ++ if (len <= 0) ++ rmc_db = NULL; ++ ++ /* If the board has a fragment in rmc database, append it to the cmdline */ ++ if (rmc_db && !rmc_gimme_file(sys_table, rmc_db, "KBOOTPARAM", &rmc_file)) { ++ CHAR8 *line; ++ UINTN i = 0; ++ UINTN j; ++ ++ line = AllocatePool(rmc_file.blob_len + cmdline_len + 2); ++ ++ while (i < cmdline_len && cmdline[i] != '\0') { ++ line[i] = cmdline[i]; ++ i++; ++ } ++ ++ line[i++] = ' '; ++ ++ for (j=0; j < rmc_file.blob_len; j++) ++ line[i+j] = rmc_file.blob[j]; ++ line[i+j] = '\0'; ++ ++ cmdline = line; ++ cmdline_len = i + j; ++ ++ FreePool(rmc_db); ++ } ++ + /* export the device path this image is started from */ + if (disk_get_part_uuid(loaded_image->DeviceHandle, uuid) == EFI_SUCCESS) + efivar_set(L"LoaderDevicePartUUID", uuid, FALSE); +-- +2.14.3 + -- cgit v1.2.3-54-g00ecf