2018-02-05 16:02:49 +00:00
|
|
|
From 637800493945ffed2f454756300437a4ec86e3b1 Mon Sep 17 00:00:00 2001
|
2017-07-19 20:46:34 +00:00
|
|
|
From: Hauke Mehrtens <hauke@hauke-m.de>
|
|
|
|
Date: Wed, 19 Jul 2017 22:23:15 +0200
|
2018-02-05 16:02:49 +00:00
|
|
|
Subject: mkimage: check environment for dtc binary location
|
2017-07-19 20:46:34 +00:00
|
|
|
|
|
|
|
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(-)
|
|
|
|
|
|
|
|
--- a/tools/fit_image.c
|
|
|
|
+++ b/tools/fit_image.c
|
2018-12-19 11:53:52 +00:00
|
|
|
@@ -656,9 +656,14 @@ static int fit_handle_file(struct image_
|
2017-07-19 20:46:34 +00:00
|
|
|
}
|
|
|
|
*cmd = '\0';
|
|
|
|
} else if (params->datafile) {
|
|
|
|
+ const char* dtc = getenv("DTC");
|
|
|
|
+
|
|
|
|
+ if (!dtc)
|
|
|
|
+ dtc = MKIMAGE_DTC;
|
|
|
|
+
|
2018-06-09 16:40:16 +00:00
|
|
|
/* dtc -I dts -O dtb -p 500 -o tmpfile datafile */
|
|
|
|
snprintf(cmd, sizeof(cmd), "%s %s -o \"%s\" \"%s\"",
|
|
|
|
- MKIMAGE_DTC, params->dtc, tmpfile, params->datafile);
|
|
|
|
+ dtc, params->dtc, tmpfile, params->datafile);
|
2017-07-19 20:46:34 +00:00
|
|
|
debug("Trying to execute \"%s\"\n", cmd);
|
|
|
|
} else {
|
2018-02-05 16:02:49 +00:00
|
|
|
snprintf(cmd, sizeof(cmd), "cp \"%s\" \"%s\"",
|