diff options
author | Chris Smart <chris@distroguy.com> | 2016-10-21 17:04:26 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-10-25 20:06:43 +1100 |
commit | 879caa27dd19873510f9ea58cdefb4775197abd2 (patch) | |
tree | 85f956d0987e3728894113d3f228669ef9ce0161 | |
parent | f9302f34e1a5501a21f3926d968c2bc0e36f069b (diff) | |
download | skiboot-879caa27dd19873510f9ea58cdefb4775197abd2.zip skiboot-879caa27dd19873510f9ea58cdefb4775197abd2.tar.gz skiboot-879caa27dd19873510f9ea58cdefb4775197abd2.tar.bz2 |
core/init.c: Fix bootargs parsing
Currently the bootargs are unconditionally deleted, which causes
a bug where the bootargs passed in by the device tree are lost.
This patch deletes bootargs only if it needs to be replaced by the NVRAM
entry.
This patch also removes KERNEL_COMMAND_LINE config option in favour of
using the NVRAM or a device tree.
Signed-off-by: Chris Smart <chris@distroguy.com>
Acked-by: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | core/init.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/core/init.c b/core/init.c index 43ce3a0..7d75fd2 100644 --- a/core/init.c +++ b/core/init.c @@ -502,16 +502,12 @@ void __noreturn load_and_boot_kernel(bool is_reboot) */ occ_pstates_init(); - /* Set kernel command line argument if specified */ - dt_check_del_prop(dt_chosen, "bootargs"); + /* Use nvram bootargs over device tree */ cmdline = nvram_query("bootargs"); -#ifdef 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")) + if (cmdline) { + dt_check_del_prop(dt_chosen, "bootargs"); dt_add_property_string(dt_chosen, "bootargs", cmdline); + } op_display(OP_LOG, OP_MOD_INIT, 0x000B); |