[U-Boot] LIBFDT - changing command line

Jerry Van Baren gvb.uboot at gmail.com
Thu Aug 13 04:10:45 CEST 2009


Hi Michal,

Michal Simek wrote:
> Jerry Van Baren wrote:
>> Hi Michal
>>
>> Michal Simek wrote:
>>> Hi All,
>>>
>>> I would like to use fdt for changing command line in DTB but
>>> I found there is one problem if I have longer command line which contains
>>> any spaces.
>>> Below is my workflow.
>>> If I understand correctly the problem is in
>>> cmd_fdt.c:fdt_parse_prop:593-603.
>>> It will be worth to add case for supporting
>>> fdt set /chosen bootargs "console=ttyUL root=/dev/mtdblock0"
>>> copy from first " to next "
>>>
>>> Or is it there any solution which I miss for this case?
>>>
>>> Thanks,
>>> Michal
>> It is somewhat ugly, but the you can use "\" to escape the spaces:
>>   fdt set /chosen bootargs console=ttyUL\ root=/dev/mtdblock0
> 
> Of course I tried it but simply not work.
> 
> 
> U-Boot-mONStR> fdt list /chosen
> chosen {
>         bootargs = "console=ttyUL0,115200 highres=on root=/dev/mtdblock0";
>         linux,stdout-path = "/plb at 0/serial at 84000000";
> };
> U-Boot-mONStR> fdt set /chosen bootargs console=ttyUL\ root=dev
> U-Boot-mONStR> fdt list /chosen
> chosen {
>         bootargs = "root=dev";
>         linux,stdout-path = "/plb at 0/serial at 84000000";
> };
> U-Boot-mONStR>
> 
> Can you tried it on your ppc?
> 
> Michal

It is working for me.  Are you running the "hush" shell or the old 
scripting interpreter?

=> fdt print /chosen
chosen {
         linux,stdout-path = "/soc8360 at e0000000/serial at 4500";
};
=> fdt set /chosen bootargs console=ttyUL\ root=/dev/mtdblock0
=> fdt print /chosen
chosen {
         bootargs = "console=ttyUL root=/dev/mtdblock0";
         linux,stdout-path = "/soc8360 at e0000000/serial at 4500";
};
=> fdt set /chosen bootargs console=ttyUL\ root=dev
=> fdt print /chosen
chosen {
         bootargs = "console=ttyUL root=dev";
         linux,stdout-path = "/soc8360 at e0000000/serial at 4500";
};

Best regards,
gvb


More information about the U-Boot mailing list