diff mbox series

[U-Boot] tools/mkimage: Use proper output parameter in dtc-system call

Message ID 1520496013-10758-1-git-send-email-stefan.theil@mixed-mode.de
State Accepted
Commit 63f881d46a9745139235be9d8cb892ada6159ea1
Delegated to: Tom Rini
Headers show
Series [U-Boot] tools/mkimage: Use proper output parameter in dtc-system call | expand

Commit Message

Stefan Theil March 8, 2018, 8 a.m. UTC
The system call used by mkimage to run dtc redirects stdout to a
temporary file. This can cause problems on Windows (with a MinGW
cross-compiled version). Using the "-o" dtc parameter avoids
this problem.

Signed-off-by: Stefan Theil <stefan.theil@mixed-mode.de>
---
 tools/fit_image.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Tom Rini March 8, 2018, 5:20 p.m. UTC | #1
On Thu, Mar 08, 2018 at 09:00:13AM +0100, Stefan Theil wrote:

> The system call used by mkimage to run dtc redirects stdout to a
> temporary file. This can cause problems on Windows (with a MinGW
> cross-compiled version). Using the "-o" dtc parameter avoids
> this problem.
> 
> Signed-off-by: Stefan Theil <stefan.theil@mixed-mode.de>

Reviewed-by: Tom Rini <trini@konsulko.com>
Tom Rini March 9, 2018, 6:29 p.m. UTC | #2
On Thu, Mar 08, 2018 at 09:00:13AM +0100, Stefan Theil wrote:

> The system call used by mkimage to run dtc redirects stdout to a
> temporary file. This can cause problems on Windows (with a MinGW
> cross-compiled version). Using the "-o" dtc parameter avoids
> this problem.
> 
> Signed-off-by: Stefan Theil <stefan.theil@mixed-mode.de>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/tools/fit_image.c b/tools/fit_image.c
index 1db44f4..3f5cc20 100644
--- a/tools/fit_image.c
+++ b/tools/fit_image.c
@@ -650,9 +650,9 @@  static int fit_handle_file(struct image_tool_params *params)
 		}
 		*cmd = '\0';
 	} else if (params->datafile) {
-		/* 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 -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);
 		debug("Trying to execute \"%s\"\n", cmd);
 	} else {
 		snprintf(cmd, sizeof(cmd), "cp \"%s\" \"%s\"",