summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/systemd-boot/systemd-boot/0003-sd-boot-Support-global-kernel-command-line-fragment.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp/systemd-boot/systemd-boot/0003-sd-boot-Support-global-kernel-command-line-fragment.patch')
-rw-r--r--recipes-bsp/systemd-boot/systemd-boot/0003-sd-boot-Support-global-kernel-command-line-fragment.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/recipes-bsp/systemd-boot/systemd-boot/0003-sd-boot-Support-global-kernel-command-line-fragment.patch b/recipes-bsp/systemd-boot/systemd-boot/0003-sd-boot-Support-global-kernel-command-line-fragment.patch
new file mode 100644
index 00000000..a4b63557
--- /dev/null
+++ b/recipes-bsp/systemd-boot/systemd-boot/0003-sd-boot-Support-global-kernel-command-line-fragment.patch
@@ -0,0 +1,66 @@
1From 1e33f99e13a70c19c1f63f6ef1c5522a09adece6 Mon Sep 17 00:00:00 2001
2From: Jianxun Zhang <jianxun.zhang@linux.intel.com>
3Date: Mon, 20 Jun 2016 13:08:20 -0700
4Subject: [PATCH 3/3] sd-boot: Support global kernel command line fragment
5
6Query file blob KBOOTPARAM from RMC. If it exists, we append
7it to the new linux boot entry's cmdline. A boot entry could
8be read from a .conf file on ESP, RMC database, or embedded
9linux image. content in KBOOTPARAM is effective in all of
10these cases.
11
12Upstream-Status: Pending
13
14Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
15---
16 src/boot/efi/boot.c | 34 ++++++++++++++++++++++++++++++++++
17 1 file changed, 34 insertions(+)
18
19diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c
20index d1b029b..8dffc48 100644
21--- a/src/boot/efi/boot.c
22+++ b/src/boot/efi/boot.c
23@@ -846,6 +846,40 @@ static VOID config_add_entry(Config *config, ConfigEntry *entry) {
24 config->entries = ReallocatePool(config->entries,
25 sizeof(VOID *) * config->entry_count, sizeof(VOID *) * i);
26 }
27+
28+ /* rmc: a linux entry could be added from .conf file or an embedded linux image
29+ * we put appending global command line here to cover both of two cases.
30+ */
31+ if (entry->type == LOADER_LINUX && rmc_db && rmc_fp) {
32+ rmc_file_t rmc_kp;
33+
34+ if (!rmc_query_file_by_fp(rmc_fp, rmc_db, "KBOOTPARAM", &rmc_kp)) {
35+ CHAR8 *cmdline;
36+ CHAR16 *s;
37+ CHAR16 *t;
38+ CHAR16 *p;
39+
40+ cmdline = AllocatePool(rmc_kp.blob_len * sizeof(CHAR8) + 1);
41+ CopyMem(cmdline, rmc_kp.blob, rmc_kp.blob_len);
42+ cmdline[rmc_kp.blob_len] = '\0';
43+ p = stra_to_str(cmdline);
44+ t = p;
45+
46+ while (*t) {
47+ if (*t == '\n')
48+ *t = '\0';
49+ t++;
50+ }
51+
52+ s = PoolPrint(L"%s %s", entry->options, p);
53+ FreePool(entry->options);
54+ FreePool(p);
55+ FreePool(cmdline);
56+
57+ entry->options = s;
58+ }
59+ }
60+
61 config->entries[config->entry_count++] = entry;
62 }
63
64--
652.7.4
66