[U-Boot] [PATCH] mkimage: check environment for dtc binary location

Simon Glass sjg at chromium.org
Tue Aug 1 09:49:30 UTC 2017


On 31 July 2017 at 14:17, Hauke Mehrtens <hauke at hauke-m.de> wrote:
> On 07/31/2017 04:45 PM, Simon Glass wrote:
>> Hi,
>>
>> On 19 July 2017 at 14:30, Hauke Mehrtens <hauke at hauke-m.de> wrote:
>>> Currently mkimage assumes the dtc binary is in the path and fails
>>> otherwise. This patch makes it check the DTC environment variable first
>>> for the dtc binary and then fall back to the default path. This makes
>>> it possible to call the u-boot build with make DTC=... and build a fit
>>> image with the dtc binary not being the the default path.
>>>
>>> Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
>>> Cc: Simon Glass <sjg at chromium.org>
>>> ---
>>>  tools/fit_image.c | 7 ++++++-
>>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/tools/fit_image.c b/tools/fit_image.c
>>> index 4dc8bd8862..d7a7b07faf 100644
>>> --- a/tools/fit_image.c
>>> +++ b/tools/fit_image.c
>>> @@ -647,9 +647,14 @@ static int fit_handle_file(struct image_tool_params *params)
>>>                 }
>>>                 *cmd = '\0';
>>>         } else if (params->datafile) {
>>> +               const char* dtc = getenv("DTC");
>>> +
>>> +               if (!dtc)
>>> +                       dtc = MKIMAGE_DTC;
>>> +
>>>                 /* dtc -I dts -O dtb -p 500 datafile > tmpfile */
>>>                 snprintf(cmd, sizeof(cmd), "%s %s %s > %s",
>>> -                        MKIMAGE_DTC, params->dtc, params->datafile, tmpfile);
>>> +                        dtc, params->dtc, params->datafile, tmpfile);
>>>                 debug("Trying to execute \"%s\"\n", cmd);
>>>         } else {
>>>                 snprintf(cmd, sizeof(cmd), "cp %s %s",
>>> --
>>> 2.11.0
>>>
>>
>> Reviewed-by: Simon Glass <sjg at chromium.org>
>>
>> But please can you add mention of this to the help (mkimage.1)
>>
>> Regards,
>> Simon
>
> Hi Simon,
>
> where should I add the description?
>
> Somewhere in the OPTIONS list or under DESCRIPTION -> FIT?

Yes I think so.

Regards,
Simon


More information about the U-Boot mailing list