[Skiboot] [PATCH 5/5] core/init: take bootargs from nvram

Oliver O'Halloran oohall at gmail.com
Mon Aug 8 12:58:33 AEST 2016


Adds support for supplying the kernel boot arguments from the "bootargs"
configuration string in the ibm,skiboot partition.

Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
 core/init.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/core/init.c b/core/init.c
index 1181bdaab357..61460b230e44 100644
--- a/core/init.c
+++ b/core/init.c
@@ -44,6 +44,7 @@
 #include <ipmi.h>
 #include <sensor.h>
 #include <xive.h>
+#include <nvram.h>
 
 enum proc_gen proc_gen;
 
@@ -403,6 +404,7 @@ int64_t mem_dump_free(void);
 void __noreturn load_and_boot_kernel(bool is_reboot)
 {
 	const struct dt_property *memprop;
+	const char *cmdline;
 	uint64_t mem_top;
 	void *fdt;
 
@@ -448,9 +450,14 @@ void __noreturn load_and_boot_kernel(bool is_reboot)
 	occ_pstates_init();
 
 	/* Set kernel command line argument if specified */
+	cmdline = nvram_query("bootargs", NULL);
 #ifdef KERNEL_COMMAND_LINE
-	dt_add_property_string(dt_chosen, "bootargs", KERNEL_COMMAND_LINE);
+	if (!cmdline)
+		cmdline = KERNEL_COMMAND_LINE;
 #endif
+	/* some platforms always pass bootargs through the fdt */
+	if (cmdline && !dt_find_property(dt_chosen, "bootargs"))
+		dt_add_property_string(dt_chosen, "bootargs", cmdline);
 
 	op_display(OP_LOG, OP_MOD_INIT, 0x000B);
 
-- 
2.5.5



More information about the Skiboot mailing list