summaryrefslogtreecommitdiff
path: root/package/boot
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2017-07-19 22:46:34 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2017-09-18 18:36:26 +0200
commit85b7d780c58b586f2f6c01637efda45d4d77b1ac (patch)
tree9b8e98cef22e271865ebe6a1c18da3561fe3f57d /package/boot
parent1422d4435b173d0c80289327095026d7da44b5f1 (diff)
downloadmtk-20170518-85b7d780c58b586f2f6c01637efda45d4d77b1ac.zip
mtk-20170518-85b7d780c58b586f2f6c01637efda45d4d77b1ac.tar.gz
mtk-20170518-85b7d780c58b586f2f6c01637efda45d4d77b1ac.tar.bz2
uboot-sunxi: do not depend on dtc being install on host
make mkimage check the DTC environment variable first. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'package/boot')
-rw-r--r--package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch b/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch
new file mode 100644
index 0000000..d61895a
--- /dev/null
+++ b/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch
@@ -0,0 +1,35 @@
+From 5b707cdadb35d896daafff52983416e1c617745b Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Wed, 19 Jul 2017 22:23:15 +0200
+Subject: [PATCH] mkimage: check environment for dtc binary location
+
+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
+@@ -647,9 +647,14 @@ static int fit_handle_file(struct image_
+ }
+ *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",