]> git.sur5r.net Git - u-boot/commitdiff
tools/mkimage: Use proper output parameter in dtc-system call
authorStefan Theil <stefan.theil@mixed-mode.de>
Thu, 8 Mar 2018 08:00:13 +0000 (09:00 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 9 Mar 2018 17:31:07 +0000 (12:31 -0500)
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>
tools/fit_image.c

index 1db44f47a16b1be9ba6ffd45546d293498fddc90..3f5cc20e49a58caa7cdc97197e92b3a41a0fe5ba 100644 (file)
@@ -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\"",