From f0ef4e2d26a89deff97d50942f40a77edcc40867 Mon Sep 17 00:00:00 2001 From: Oliver O'Halloran Date: Wed, 17 Aug 2016 15:32:52 +1000 Subject: core/init: take bootargs from nvram Adds support for supplying the kernel boot arguments from the "bootargs" configuration string in the ibm,skiboot partition. Signed-off-by: Oliver O'Halloran Signed-off-by: Stewart Smith --- core/init.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'core/init.c') diff --git a/core/init.c b/core/init.c index d5894abc..821094fe 100644 --- a/core/init.c +++ b/core/init.c @@ -412,6 +412,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; @@ -457,9 +458,14 @@ void __noreturn load_and_boot_kernel(bool is_reboot) occ_pstates_init(); /* Set kernel command line argument if specified */ + cmdline = nvram_query("bootargs"); #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); -- cgit v1.2.1