public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] dfu: fix: Add the absolute path to the file name for ext4 write operation
@ 2014-07-16  9:38 Lukasz Majewski
  2014-07-21 16:27 ` Stephen Warren
  0 siblings, 1 reply; 4+ messages in thread
From: Lukasz Majewski @ 2014-07-16  9:38 UTC (permalink / raw)
  To: u-boot

Commit 1151b7ac10b81ecbb has cleaned up read and write operations.
Unfortunately, for correct operation the write for ext4 fs requires
absolute patch.
This patch fixes this case.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
---
 drivers/dfu/dfu_mmc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c
index 72fa03e..38aeab0 100644
--- a/drivers/dfu/dfu_mmc.c
+++ b/drivers/dfu/dfu_mmc.c
@@ -117,6 +117,7 @@ static int mmc_file_op(enum dfu_op op, struct dfu_entity *dfu,
 {
 	const char *fsname, *opname;
 	char cmd_buf[DFU_CMD_BUF_SIZE];
+	char *filename = " %s";
 	char *str_env;
 	int ret;
 
@@ -153,7 +154,10 @@ static int mmc_file_op(enum dfu_op op, struct dfu_entity *dfu,
 	if (op != DFU_OP_SIZE)
 		sprintf(cmd_buf + strlen(cmd_buf), " 0x%x", (unsigned int)buf);
 
-	sprintf(cmd_buf + strlen(cmd_buf), " %s", dfu->name);
+	if (dfu->layout == DFU_FS_EXT4 && op == DFU_OP_WRITE)
+		filename = " /%s";
+
+	sprintf(cmd_buf + strlen(cmd_buf), filename, dfu->name);
 
 	if (op == DFU_OP_WRITE)
 		sprintf(cmd_buf + strlen(cmd_buf), " %lx", *len);
-- 
2.0.0.rc2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-22 14:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-16  9:38 [U-Boot] [PATCH] dfu: fix: Add the absolute path to the file name for ext4 write operation Lukasz Majewski
2014-07-21 16:27 ` Stephen Warren
2014-07-22  8:00   ` Lukasz Majewski
2014-07-22 14:24     ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox