All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] mkimage: check environment for dtc binary location
@ 2017-07-19 20:30 Hauke Mehrtens
  2017-07-31 14:45 ` Simon Glass
  0 siblings, 1 reply; 4+ messages in thread
From: Hauke Mehrtens @ 2017-07-19 20:30 UTC (permalink / raw)
  To: u-boot

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@hauke-m.de>
Cc: Simon Glass <sjg@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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] mkimage: check environment for dtc binary location
  2017-07-19 20:30 [U-Boot] [PATCH] mkimage: check environment for dtc binary location Hauke Mehrtens
@ 2017-07-31 14:45 ` Simon Glass
  2017-07-31 20:17   ` Hauke Mehrtens
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Glass @ 2017-07-31 14:45 UTC (permalink / raw)
  To: u-boot

Hi,

On 19 July 2017 at 14:30, Hauke Mehrtens <hauke@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@hauke-m.de>
> Cc: Simon Glass <sjg@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@chromium.org>

But please can you add mention of this to the help (mkimage.1)

Regards,
Simon

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] mkimage: check environment for dtc binary location
  2017-07-31 14:45 ` Simon Glass
@ 2017-07-31 20:17   ` Hauke Mehrtens
  2017-08-01  9:49     ` Simon Glass
  0 siblings, 1 reply; 4+ messages in thread
From: Hauke Mehrtens @ 2017-07-31 20:17 UTC (permalink / raw)
  To: u-boot

On 07/31/2017 04:45 PM, Simon Glass wrote:
> Hi,
> 
> On 19 July 2017 at 14:30, Hauke Mehrtens <hauke@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@hauke-m.de>
>> Cc: Simon Glass <sjg@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@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?

Hauke

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] mkimage: check environment for dtc binary location
  2017-07-31 20:17   ` Hauke Mehrtens
@ 2017-08-01  9:49     ` Simon Glass
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2017-08-01  9:49 UTC (permalink / raw)
  To: u-boot

On 31 July 2017 at 14:17, Hauke Mehrtens <hauke@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@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@hauke-m.de>
>>> Cc: Simon Glass <sjg@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@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-01  9:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-19 20:30 [U-Boot] [PATCH] mkimage: check environment for dtc binary location Hauke Mehrtens
2017-07-31 14:45 ` Simon Glass
2017-07-31 20:17   ` Hauke Mehrtens
2017-08-01  9:49     ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.