mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-24 21:50:30 +09:00
tools/mkimage: Fix DTC run command to handle file names with space
fit_handle_file function does not quote input and output files while preparing command to run DTC to convert .its to .itb. This results in a failure if input or output files contain spaces in their names. Quote input and output files in DTC command to avoid this failure. Signed-off-by: Mirza, Taimoor <Taimoor_Mirza@mentor.com>
This commit is contained in:
parent
409f05f259
commit
a6e9810495
@ -651,11 +651,11 @@ static int fit_handle_file(struct image_tool_params *params)
|
|||||||
*cmd = '\0';
|
*cmd = '\0';
|
||||||
} else if (params->datafile) {
|
} else if (params->datafile) {
|
||||||
/* dtc -I dts -O dtb -p 500 datafile > tmpfile */
|
/* dtc -I dts -O dtb -p 500 datafile > tmpfile */
|
||||||
snprintf(cmd, sizeof(cmd), "%s %s %s > %s",
|
snprintf(cmd, sizeof(cmd), "%s %s \"%s\" > \"%s\"",
|
||||||
MKIMAGE_DTC, params->dtc, params->datafile, tmpfile);
|
MKIMAGE_DTC, params->dtc, params->datafile, tmpfile);
|
||||||
debug("Trying to execute \"%s\"\n", cmd);
|
debug("Trying to execute \"%s\"\n", cmd);
|
||||||
} else {
|
} else {
|
||||||
snprintf(cmd, sizeof(cmd), "cp %s %s",
|
snprintf(cmd, sizeof(cmd), "cp \"%s\" \"%s\"",
|
||||||
params->imagefile, tmpfile);
|
params->imagefile, tmpfile);
|
||||||
}
|
}
|
||||||
if (*cmd && system(cmd) == -1) {
|
if (*cmd && system(cmd) == -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user