diff options
author | Jianxun Zhang <jianxun.zhang@linux.intel.com> | 2016-11-28 14:00:45 -0800 |
---|---|---|
committer | Saul Wold <sgw@linux.intel.com> | 2016-12-05 18:11:14 -0800 |
commit | 58e5069ee34edd585ca11dfa387bd122d45995aa (patch) | |
tree | 682e3c2051dc60d678e2f1fe9ee80fab0b336d23 /common | |
parent | 5bd26ee16c65d0bb8fb907a14f008d9d40bcfa53 (diff) | |
download | meta-intel-58e5069ee34edd585ca11dfa387bd122d45995aa.tar.gz |
rmc: integration update
This is a whole package of rmc work in meta-intel to reflect
some major changes in the upstream project:
In rmc.bb recipe, EFI_ARCH, path of EFI header files, and
dependency on gnu-efi are removed with the updated revision.
In systemd-boot, patches to integrate with rmc are re-worked
mainly because of new APIs. Size of patches are smaller than
the previous implementation. Notice we still use multiple APIs
instead of calling an one-step interface multiple times, to get
some potential runtime performance benefit. (rmc tool in user
space is changed to use single API in the upstream project.)
Fixes [YOCTO #10086]
Fixes [YOCTO #10671]
Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/recipes-bsp/rmc/rmc.bb | 20 | ||||
-rw-r--r-- | common/recipes-bsp/systemd-boot/systemd-boot.bbappend | 4 | ||||
-rw-r--r-- | common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-RMC-library-into-bootloader.patch (renamed from common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-RMC-libraries-into-bootloader.patch) | 10 | ||||
-rw-r--r-- | common/recipes-bsp/systemd-boot/systemd-boot/0002-sd-boot-Load-board-specific-boot-entries-from-RMC-da.patch | 55 | ||||
-rw-r--r-- | common/recipes-bsp/systemd-boot/systemd-boot/0003-sd-boot-Support-global-kernel-command-line-fragment.patch | 10 |
5 files changed, 38 insertions, 61 deletions
diff --git a/common/recipes-bsp/rmc/rmc.bb b/common/recipes-bsp/rmc/rmc.bb index f69b41a0..8c89a99c 100644 --- a/common/recipes-bsp/rmc/rmc.bb +++ b/common/recipes-bsp/rmc/rmc.bb | |||
@@ -14,33 +14,23 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=838c366f69b72c5df05c96dff79b35f2" | |||
14 | 14 | ||
15 | SRC_URI = "git://git.yoctoproject.org/rmc" | 15 | SRC_URI = "git://git.yoctoproject.org/rmc" |
16 | 16 | ||
17 | SRCREV = "2e38d056f86c0457f3a5ca7ef848545bbb190e47" | 17 | SRCREV = "4799cb89b543712390d863a6fc50a58881590fa2" |
18 | 18 | ||
19 | S = "${WORKDIR}/git" | 19 | S = "${WORKDIR}/git" |
20 | 20 | ||
21 | DEPENDS_class-target = "gnu-efi" | ||
22 | |||
23 | COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux*" | 21 | COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux*" |
24 | 22 | ||
25 | EXTRA_OEMAKE='RMC_CFLAGS="-Wl,--hash-style=both"' | 23 | TARGET_CFLAGS +="-Wl,--hash-style=both" |
26 | |||
27 | # from gnu-efi, we should align arch-mapping with it. | ||
28 | def rmc_efi_arch(d): | ||
29 | import re | ||
30 | arch = d.getVar("TARGET_ARCH", True) | ||
31 | if re.match("i[3456789]86", arch): | ||
32 | return "ia32" | ||
33 | return arch | ||
34 | 24 | ||
35 | SECURITY_CFLAGS_remove_class-target = "-fstack-protector-strong" | 25 | SECURITY_CFLAGS_remove_class-target = "-fstack-protector-strong" |
36 | do_compile_class-target() { | 26 | do_compile_class-target() { |
37 | oe_runmake | 27 | oe_runmake |
38 | oe_runmake RMC_EFI_HEADER_PREFIX=${STAGING_INCDIR}/efi RMC_EFI_ARCH="${@rmc_efi_arch(d)}" -f Makefile.efi | 28 | oe_runmake -f Makefile.efi |
39 | } | 29 | } |
40 | 30 | ||
41 | do_install() { | 31 | do_install() { |
42 | oe_runmake RMC_EFI_ARCH="${@rmc_efi_arch(d)}" RMC_INSTALL_PREFIX=${D}/usr install | 32 | oe_runmake RMC_INSTALL_PREFIX=${D}/usr install |
43 | oe_runmake RMC_EFI_ARCH="${@rmc_efi_arch(d)}" RMC_INSTALL_PREFIX=${D}/usr -f Makefile.efi install | 33 | oe_runmake RMC_INSTALL_PREFIX=${D}/usr -f Makefile.efi install |
44 | } | 34 | } |
45 | 35 | ||
46 | do_install_class-native() { | 36 | do_install_class-native() { |
diff --git a/common/recipes-bsp/systemd-boot/systemd-boot.bbappend b/common/recipes-bsp/systemd-boot/systemd-boot.bbappend index ed317554..2aecc3f9 100644 --- a/common/recipes-bsp/systemd-boot/systemd-boot.bbappend +++ b/common/recipes-bsp/systemd-boot/systemd-boot.bbappend | |||
@@ -2,7 +2,7 @@ DEPENDS_append_intel-x86-common = " rmc" | |||
2 | 2 | ||
3 | FILESEXTRAPATHS_prepend := "${THISDIR}/systemd-boot:" | 3 | FILESEXTRAPATHS_prepend := "${THISDIR}/systemd-boot:" |
4 | 4 | ||
5 | EXTRA_OEMAKE_append_intel-x86-common = ' EFI_LDFLAGS="-L${STAGING_DIR_HOST}/usr/lib" EFI_CFLAGS="-I${STAGING_INCDIR}/rmc/efi -DRMC_EFI"' | 5 | EXTRA_OEMAKE_append_intel-x86-common = ' EFI_LDFLAGS="-L${STAGING_DIR_HOST}/usr/lib" EFI_CFLAGS="-I${STAGING_INCDIR}/rmc -DRMC_EFI"' |
6 | 6 | ||
7 | # Pin systemd revision down for systemd-boot recipe. | 7 | # Pin systemd revision down for systemd-boot recipe. |
8 | # Patches could not be applied cleanly when systemd in OE is updated, | 8 | # Patches could not be applied cleanly when systemd in OE is updated, |
@@ -15,7 +15,7 @@ EXTRA_OEMAKE_append_intel-x86-common = ' EFI_LDFLAGS="-L${STAGING_DIR_HOST}/usr/ | |||
15 | SRCREV_intel-x86-common = "3a74d4fc90cb322a4784a3515bef7118c8f8c5ba" | 15 | SRCREV_intel-x86-common = "3a74d4fc90cb322a4784a3515bef7118c8f8c5ba" |
16 | 16 | ||
17 | SRC_URI_append_intel-x86-common = " \ | 17 | SRC_URI_append_intel-x86-common = " \ |
18 | file://0001-sd-boot-Link-RMC-libraries-into-bootloader.patch \ | 18 | file://0001-sd-boot-Link-RMC-library-into-bootloader.patch \ |
19 | file://0002-sd-boot-Load-board-specific-boot-entries-from-RMC-da.patch \ | 19 | file://0002-sd-boot-Load-board-specific-boot-entries-from-RMC-da.patch \ |
20 | file://0003-sd-boot-Support-global-kernel-command-line-fragment.patch \ | 20 | file://0003-sd-boot-Support-global-kernel-command-line-fragment.patch \ |
21 | file://0001-efi-boot.c-workaround-for-Joule-BIOS-hang.patch \ | 21 | file://0001-efi-boot.c-workaround-for-Joule-BIOS-hang.patch \ |
diff --git a/common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-RMC-libraries-into-bootloader.patch b/common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-RMC-library-into-bootloader.patch index c8867a24..626efce8 100644 --- a/common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-RMC-libraries-into-bootloader.patch +++ b/common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-RMC-library-into-bootloader.patch | |||
@@ -1,9 +1,9 @@ | |||
1 | From b7775f24928fca01600cac1077ff3f215aa6362d Mon Sep 17 00:00:00 2001 | 1 | From 1ccd031ce97501f8ee63f39e8794437d568115dc Mon Sep 17 00:00:00 2001 |
2 | From: Jianxun Zhang <jianxun.zhang@linux.intel.com> | 2 | From: Jianxun Zhang <jianxun.zhang@linux.intel.com> |
3 | Date: Sat, 21 May 2016 18:52:07 -0700 | 3 | Date: Sat, 21 May 2016 18:52:07 -0700 |
4 | Subject: [PATCH 1/3] sd-boot: Link RMC libraries into bootloader | 4 | Subject: [PATCH 1/3] sd-boot: Link RMC library into bootloader |
5 | 5 | ||
6 | Add two RMC libraries into bootloader binary. EFI stub is not changed | 6 | Add RMC library into bootloader binary. EFI stub is not changed |
7 | until we really need rmc in stub. | 7 | until we really need rmc in stub. |
8 | 8 | ||
9 | Upstream-Status: Pending | 9 | Upstream-Status: Pending |
@@ -14,7 +14,7 @@ Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com> | |||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | 14 | 1 file changed, 1 insertion(+), 1 deletion(-) |
15 | 15 | ||
16 | diff --git a/Makefile.am b/Makefile.am | 16 | diff --git a/Makefile.am b/Makefile.am |
17 | index 305099a..ff21ebd 100644 | 17 | index 305099a..df176a5 100644 |
18 | --- a/Makefile.am | 18 | --- a/Makefile.am |
19 | +++ b/Makefile.am | 19 | +++ b/Makefile.am |
20 | @@ -2802,7 +2802,7 @@ $(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(t | 20 | @@ -2802,7 +2802,7 @@ $(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(t |
@@ -22,7 +22,7 @@ index 305099a..ff21ebd 100644 | |||
22 | $(systemd_boot_solib): $(systemd_boot_objects) | 22 | $(systemd_boot_solib): $(systemd_boot_objects) |
23 | $(AM_V_CCLD)$(LD) $(efi_ldflags) $(systemd_boot_objects) \ | 23 | $(AM_V_CCLD)$(LD) $(efi_ldflags) $(systemd_boot_objects) \ |
24 | - -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \ | 24 | - -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \ |
25 | + -o $@ -lefi -lgnuefi -lrmclefi -lrsmpefi $(shell $(CC) -print-libgcc-file-name); \ | 25 | + -o $@ -lefi -lgnuefi -lrmcefi $(shell $(CC) -print-libgcc-file-name); \ |
26 | nm -D -u $@ | grep ' U ' && exit 1 || : | 26 | nm -D -u $@ | grep ' U ' && exit 1 || : |
27 | 27 | ||
28 | $(systemd_boot): $(systemd_boot_solib) | 28 | $(systemd_boot): $(systemd_boot_solib) |
diff --git a/common/recipes-bsp/systemd-boot/systemd-boot/0002-sd-boot-Load-board-specific-boot-entries-from-RMC-da.patch b/common/recipes-bsp/systemd-boot/systemd-boot/0002-sd-boot-Load-board-specific-boot-entries-from-RMC-da.patch index ddad940b..e88012c3 100644 --- a/common/recipes-bsp/systemd-boot/systemd-boot/0002-sd-boot-Load-board-specific-boot-entries-from-RMC-da.patch +++ b/common/recipes-bsp/systemd-boot/systemd-boot/0002-sd-boot-Load-board-specific-boot-entries-from-RMC-da.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From f714cdc84b791d84099f7461c4f223677456720f Mon Sep 17 00:00:00 2001 | 1 | From a3c4fc8c2847fe289a617bcba1d905f580f0e18d Mon Sep 17 00:00:00 2001 |
2 | From: Jianxun Zhang <jianxun.zhang@linux.intel.com> | 2 | From: Jianxun Zhang <jianxun.zhang@linux.intel.com> |
3 | Date: Wed, 1 Jun 2016 16:32:22 -0700 | 3 | Date: Wed, 1 Jun 2016 16:32:22 -0700 |
4 | Subject: [PATCH 2/3] sd-boot: Load board-specific boot entries from RMC | 4 | Subject: [PATCH 2/3] sd-boot: Load board-specific boot entries from RMC |
@@ -39,23 +39,22 @@ Upstream-Status: Pending | |||
39 | 39 | ||
40 | Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com> | 40 | Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com> |
41 | --- | 41 | --- |
42 | src/boot/efi/boot.c | 160 +++++++++++++++++++++++++++++++++++++++++++++++++++- | 42 | src/boot/efi/boot.c | 147 +++++++++++++++++++++++++++++++++++++++++++++++++++- |
43 | 1 file changed, 158 insertions(+), 2 deletions(-) | 43 | 1 file changed, 145 insertions(+), 2 deletions(-) |
44 | 44 | ||
45 | diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c | 45 | diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c |
46 | index 30c1ead..43b0793 100644 | 46 | index 30c1ead..d1b029b 100644 |
47 | --- a/src/boot/efi/boot.c | 47 | --- a/src/boot/efi/boot.c |
48 | +++ b/src/boot/efi/boot.c | 48 | +++ b/src/boot/efi/boot.c |
49 | @@ -15,6 +15,8 @@ | 49 | @@ -15,6 +15,7 @@ |
50 | 50 | ||
51 | #include <efi.h> | 51 | #include <efi.h> |
52 | #include <efilib.h> | 52 | #include <efilib.h> |
53 | +#include <rmcl.h> | 53 | +#include <rmc_api.h> |
54 | +#include <rsmp.h> | ||
55 | 54 | ||
56 | #include "console.h" | 55 | #include "console.h" |
57 | #include "disk.h" | 56 | #include "disk.h" |
58 | @@ -33,6 +35,9 @@ static const char __attribute__((used)) magic[] = "#### LoaderInfo: systemd-boot | 57 | @@ -33,6 +34,9 @@ static const char __attribute__((used)) magic[] = "#### LoaderInfo: systemd-boot |
59 | 58 | ||
60 | static const EFI_GUID global_guid = EFI_GLOBAL_VARIABLE; | 59 | static const EFI_GUID global_guid = EFI_GLOBAL_VARIABLE; |
61 | 60 | ||
@@ -65,7 +64,7 @@ index 30c1ead..43b0793 100644 | |||
65 | enum loader_type { | 64 | enum loader_type { |
66 | LOADER_UNDEFINED, | 65 | LOADER_UNDEFINED, |
67 | LOADER_EFI, | 66 | LOADER_EFI, |
68 | @@ -1702,6 +1707,148 @@ static VOID config_free(Config *config) { | 67 | @@ -1702,6 +1706,136 @@ static VOID config_free(Config *config) { |
69 | FreePool(config->entry_oneshot); | 68 | FreePool(config->entry_oneshot); |
70 | } | 69 | } |
71 | 70 | ||
@@ -123,13 +122,8 @@ index 30c1ead..43b0793 100644 | |||
123 | + * this function returns 0. | 122 | + * this function returns 0. |
124 | + */ | 123 | + */ |
125 | + | 124 | + |
126 | +static UINTN rmc_initialize(EFI_FILE *root_dir, CHAR8 **db, rmc_fingerprint_t **fp) { | 125 | +static UINTN rmc_initialize(EFI_FILE *root_dir, EFI_SYSTEM_TABLE *sys_table, CHAR8 **db, rmc_fingerprint_t **fp) { |
127 | + UINTN len; | 126 | + UINTN len; |
128 | + EFI_GUID smbios_guid = SMBIOS_TABLE_GUID; | ||
129 | + EFI_GUID smbios3_guid = SMBIOS3_TABLE_GUID; | ||
130 | + VOID *smbios_entry = NULL; | ||
131 | + UINT64 smbios_struct_addr = 0; | ||
132 | + UINT16 smbios_struct_len = 0; | ||
133 | + UINTN ret = 1; | 127 | + UINTN ret = 1; |
134 | + | 128 | + |
135 | + if (!db || !fp) | 129 | + if (!db || !fp) |
@@ -144,18 +138,11 @@ index 30c1ead..43b0793 100644 | |||
144 | + if (len <= 0) | 138 | + if (len <= 0) |
145 | + goto done; | 139 | + goto done; |
146 | + | 140 | + |
147 | + /* locate smbios entry table, try both 32 and 64 bit */ | ||
148 | + if (LibGetSystemConfigurationTable(&smbios3_guid, &smbios_entry) != EFI_SUCCESS | ||
149 | + && LibGetSystemConfigurationTable(&smbios_guid, &smbios_entry) != EFI_SUCCESS) | ||
150 | + goto done; | ||
151 | + | ||
152 | + /* call rsmp to get fp */ | ||
153 | + if (rsmp_get_smbios_strcut(smbios_entry, &smbios_struct_addr, &smbios_struct_len)) | ||
154 | + goto done; | ||
155 | + | ||
156 | + *fp = AllocateZeroPool(sizeof(rmc_fingerprint_t)); | 141 | + *fp = AllocateZeroPool(sizeof(rmc_fingerprint_t)); |
157 | + | 142 | + /* call rmc to get fingerprint. We will use single-action rmc APIs to query multiple files. |
158 | + if (rsmp_get_fingerprint_from_smbios_struct((BYTE *) smbios_struct_addr, *fp)) | 143 | + * This should bring a better performance than calling double-action rmc API every time. |
144 | + */ | ||
145 | + if (rmc_get_fingerprint(sys_table, *fp)) | ||
159 | + goto done; | 146 | + goto done; |
160 | + | 147 | + |
161 | + ret = 0; | 148 | + ret = 0; |
@@ -174,7 +161,7 @@ index 30c1ead..43b0793 100644 | |||
174 | +static BOOLEAN config_load_rmc_entries(Config *config, EFI_HANDLE *device, CHAR16 *loaded_image_path, CHAR8 *db, rmc_fingerprint_t *fp) { | 161 | +static BOOLEAN config_load_rmc_entries(Config *config, EFI_HANDLE *device, CHAR16 *loaded_image_path, CHAR8 *db, rmc_fingerprint_t *fp) { |
175 | + CHAR8 *boot_entry = NULL; | 162 | + CHAR8 *boot_entry = NULL; |
176 | + CHAR8 *boot_config = NULL; | 163 | + CHAR8 *boot_config = NULL; |
177 | + rmc_policy_file_t rp; | 164 | + rmc_file_t rp; |
178 | + CHAR8 *line; | 165 | + CHAR8 *line; |
179 | + UINT64 pos = 0; | 166 | + UINT64 pos = 0; |
180 | + BOOLEAN ret = FALSE; | 167 | + BOOLEAN ret = FALSE; |
@@ -183,7 +170,7 @@ index 30c1ead..43b0793 100644 | |||
183 | + return ret; | 170 | + return ret; |
184 | + | 171 | + |
185 | + /* query boot entry config file */ | 172 | + /* query boot entry config file */ |
186 | + if (query_policy_from_db(fp, db, RMC_POLICY_BLOB, "BOOTENTRY.CONFIG", &rp)) | 173 | + if (rmc_query_file_by_fp(fp, db, "BOOTENTRY.CONFIG", &rp)) |
187 | + return ret; | 174 | + return ret; |
188 | + | 175 | + |
189 | + /* file blob read from rmc db is not necessarily null-terminated, and we | 176 | + /* file blob read from rmc db is not necessarily null-terminated, and we |
@@ -194,7 +181,7 @@ index 30c1ead..43b0793 100644 | |||
194 | + boot_config[rp.blob_len] = '\0'; | 181 | + boot_config[rp.blob_len] = '\0'; |
195 | + /* parse boot entry config */ | 182 | + /* parse boot entry config */ |
196 | + while ((line = get_line(boot_config, &pos))) { | 183 | + while ((line = get_line(boot_config, &pos))) { |
197 | + if (query_policy_from_db(fp, db, RMC_POLICY_BLOB, (char *)line, &rp)) | 184 | + if (rmc_query_file_by_fp(fp, db, (char *)line, &rp)) |
198 | + continue; | 185 | + continue; |
199 | + if (rp.blob_len > 0) { | 186 | + if (rp.blob_len > 0) { |
200 | + boot_entry = AllocatePool(rp.blob_len * sizeof(CHAR8) + 1); | 187 | + boot_entry = AllocatePool(rp.blob_len * sizeof(CHAR8) + 1); |
@@ -214,7 +201,7 @@ index 30c1ead..43b0793 100644 | |||
214 | EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { | 201 | EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { |
215 | CHAR16 *s; | 202 | CHAR16 *s; |
216 | CHAR8 *b; | 203 | CHAR8 *b; |
217 | @@ -1714,6 +1861,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { | 204 | @@ -1714,6 +1848,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { |
218 | UINT64 init_usec; | 205 | UINT64 init_usec; |
219 | BOOLEAN menu = FALSE; | 206 | BOOLEAN menu = FALSE; |
220 | CHAR16 uuid[37]; | 207 | CHAR16 uuid[37]; |
@@ -222,16 +209,16 @@ index 30c1ead..43b0793 100644 | |||
222 | 209 | ||
223 | InitializeLib(image, sys_table); | 210 | InitializeLib(image, sys_table); |
224 | init_usec = time_usec(); | 211 | init_usec = time_usec(); |
225 | @@ -1745,6 +1893,8 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { | 212 | @@ -1745,6 +1880,8 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { |
226 | return EFI_LOAD_ERROR; | 213 | return EFI_LOAD_ERROR; |
227 | } | 214 | } |
228 | 215 | ||
229 | + /* Initialize rmc before loading any config */ | 216 | + /* Initialize rmc before loading any config */ |
230 | + rmc_initialize(root_dir, &rmc_db, &rmc_fp); | 217 | + rmc_initialize(root_dir, sys_table, &rmc_db, &rmc_fp); |
231 | 218 | ||
232 | /* the filesystem path to this image, to prevent adding ourselves to the menu */ | 219 | /* the filesystem path to this image, to prevent adding ourselves to the menu */ |
233 | loaded_image_path = DevicePathToStr(loaded_image->FilePath); | 220 | loaded_image_path = DevicePathToStr(loaded_image->FilePath); |
234 | @@ -1753,11 +1903,15 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { | 221 | @@ -1753,11 +1890,15 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { |
235 | ZeroMem(&config, sizeof(Config)); | 222 | ZeroMem(&config, sizeof(Config)); |
236 | config_load_defaults(&config, root_dir); | 223 | config_load_defaults(&config, root_dir); |
237 | 224 | ||
@@ -249,7 +236,7 @@ index 30c1ead..43b0793 100644 | |||
249 | 236 | ||
250 | /* sort entries after version number */ | 237 | /* sort entries after version number */ |
251 | config_sort_entries(&config); | 238 | config_sort_entries(&config); |
252 | @@ -1851,6 +2005,8 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { | 239 | @@ -1851,6 +1992,8 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { |
253 | out: | 240 | out: |
254 | FreePool(loaded_image_path); | 241 | FreePool(loaded_image_path); |
255 | config_free(&config); | 242 | config_free(&config); |
diff --git a/common/recipes-bsp/systemd-boot/systemd-boot/0003-sd-boot-Support-global-kernel-command-line-fragment.patch b/common/recipes-bsp/systemd-boot/systemd-boot/0003-sd-boot-Support-global-kernel-command-line-fragment.patch index 6d077f19..a4b63557 100644 --- a/common/recipes-bsp/systemd-boot/systemd-boot/0003-sd-boot-Support-global-kernel-command-line-fragment.patch +++ b/common/recipes-bsp/systemd-boot/systemd-boot/0003-sd-boot-Support-global-kernel-command-line-fragment.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From a38be4fe8ffed142abbba92f7ad91a8f7b8f1ace Mon Sep 17 00:00:00 2001 | 1 | From 1e33f99e13a70c19c1f63f6ef1c5522a09adece6 Mon Sep 17 00:00:00 2001 |
2 | From: Jianxun Zhang <jianxun.zhang@linux.intel.com> | 2 | From: Jianxun Zhang <jianxun.zhang@linux.intel.com> |
3 | Date: Mon, 20 Jun 2016 13:08:20 -0700 | 3 | Date: Mon, 20 Jun 2016 13:08:20 -0700 |
4 | Subject: [PATCH 3/3] sd-boot: Support global kernel command line fragment | 4 | Subject: [PATCH 3/3] sd-boot: Support global kernel command line fragment |
@@ -17,10 +17,10 @@ Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com> | |||
17 | 1 file changed, 34 insertions(+) | 17 | 1 file changed, 34 insertions(+) |
18 | 18 | ||
19 | diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c | 19 | diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c |
20 | index 43b0793..3dcd9a5 100644 | 20 | index d1b029b..8dffc48 100644 |
21 | --- a/src/boot/efi/boot.c | 21 | --- a/src/boot/efi/boot.c |
22 | +++ b/src/boot/efi/boot.c | 22 | +++ b/src/boot/efi/boot.c |
23 | @@ -847,6 +847,40 @@ static VOID config_add_entry(Config *config, ConfigEntry *entry) { | 23 | @@ -846,6 +846,40 @@ static VOID config_add_entry(Config *config, ConfigEntry *entry) { |
24 | config->entries = ReallocatePool(config->entries, | 24 | config->entries = ReallocatePool(config->entries, |
25 | sizeof(VOID *) * config->entry_count, sizeof(VOID *) * i); | 25 | sizeof(VOID *) * config->entry_count, sizeof(VOID *) * i); |
26 | } | 26 | } |
@@ -29,9 +29,9 @@ index 43b0793..3dcd9a5 100644 | |||
29 | + * we put appending global command line here to cover both of two cases. | 29 | + * we put appending global command line here to cover both of two cases. |
30 | + */ | 30 | + */ |
31 | + if (entry->type == LOADER_LINUX && rmc_db && rmc_fp) { | 31 | + if (entry->type == LOADER_LINUX && rmc_db && rmc_fp) { |
32 | + rmc_policy_file_t rmc_kp; | 32 | + rmc_file_t rmc_kp; |
33 | + | 33 | + |
34 | + if (!query_policy_from_db(rmc_fp, rmc_db, RMC_POLICY_BLOB, "KBOOTPARAM", &rmc_kp)) { | 34 | + if (!rmc_query_file_by_fp(rmc_fp, rmc_db, "KBOOTPARAM", &rmc_kp)) { |
35 | + CHAR8 *cmdline; | 35 | + CHAR8 *cmdline; |
36 | + CHAR16 *s; | 36 | + CHAR16 *s; |
37 | + CHAR16 *t; | 37 | + CHAR16 *t; |