[Skiboot] [PATCH] core/init.c: Fix bootargs parsing

Balbir Singh bsingharora at gmail.com
Mon Oct 24 12:15:04 AEDT 2016



On 24/10/16 11:12, Chris Smart wrote:
> On Mon, Oct 24, 2016 at 10:54:51AM +1100, Balbir Singh wrote:
>>
>>
>> On 21/10/16 17:04, Chris Smart wrote:
>>> 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 at distroguy.com>
>>> ---
>>> core/init.c | 12 ++++--------
>>> 1 file changed, 4 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/core/init.c b/core/init.c
>>> index 43ce3a06fb65..7d75fd28d04c 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);
> 
> Thanks Balbir.
> 
>>
>> The indentation needs to be checked. It also changes the logic of
>> the code.  I am not sure if overriding from nvram is desriable even
> 
> Looks OK to me on the original patch, just not on your reply - unless
> I'm missing something?
> 
>> if bootargs is explictly specified. if that is desirable, how about
>> a debug statement stating that we are overriding bootargs with whats
>> in nvram.
>>
> 
> This is related to 0279d8951ead5 "Fast reboot for P8," if that helps
> drive the discussion.
> 

So looks like the only way to override bootargs is for simulators
only

Acked-by: Balbir Singh <bsingharora at gmail.com>


More information about the Skiboot mailing list