[U-Boot] [PATCH 1/8] fdtgrep: Improve error handling with invalid device tree
Joe Hershberger
joe.hershberger at gmail.com
Mon Mar 7 17:42:15 CET 2016
On Mon, Mar 7, 2016 at 10:37 AM, Masahiro Yamada
<yamada.masahiro at socionext.com> wrote:
> 2016-03-07 12:31 GMT+09:00 Simon Glass <sjg at chromium.org>:
>> Hi Masahiro,
>>
>> On 6 March 2016 at 20:07, Masahiro Yamada <yamada.masahiro at socionext.com> wrote:
>>> Hi Simon,
>>>
>>>
>>> 2016-03-07 11:45 GMT+09:00 Simon Glass <sjg at chromium.org>:
>>>> This tool requires that the aliases node be the first node in the tree. But
>>>> when it is not, it does not handle things gracefully. In fact it crashes.
>>>>
>>>> Fix this, and add a more helpful error message.
>>>>
>>>> Signed-off-by: Simon Glass <sjg at chromium.org>
>>>> Reported-by: Masahiro Yamada <yamada.masahiro at socionext.com>
>>>
>>>
>>> I think this patch would diplay a clearer hint,
>>> but would not solve the root cause.
>>>
>>>
>>>
>>> fdtgrep still crashes with the following DTS:
>>
>> Crashes?
>
> Yes.
Perhaps a language barrier?
> I applied your patch, but fdtgrep still would not work.
True, but does not work and crashes are two different things.
> Please try this.
>
>
<snip>
> OBJCOPY spl/u-boot-spl-nodtb.bin
> FDTGREP spl/u-boot-spl.dtb
> Error at 'fdt_find_regions': FDT_ERR_BADLAYOUT
> /aliases node must come before all other nodes
> Error: FDT_ERR_BADMAGIC
> make[1]: *** [spl/u-boot-spl.dtb] Error 1
> make: *** [spl/u-boot-spl] Error 2
This is just an error. It's not an ideal limitation, but it's far
better than it was. I also bet Simon is going to send a v2 that fixes
it completely.
-Joe
More information about the U-Boot
mailing list