dfu: fix: Add the absolute path to the file name for ext4 write operation
PATCH 1/1 dfu: fix: Add the absolute path to the file name for ext4 write operation
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.
--- drivers/dfu/dfu_mmc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/dfu/dfu_mmc.c +5 -1
@@ -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);
Signature · 1 line
2.0.0.rc2
PATCH 1/1 dfu: fix: Add the absolute path to the file name for ext4 write operation
Quoted 4 lines · Lukasz Majewski
Commit
1151b7ac10b81ecbbhas cleaned up read and write operations. Unfortunately, for correct operation the write for ext4 fs requires absolute patch.
This patch fixes this case.
Shouldn't the user simply supply the absolute patch name as the entity name? That's what I've been doing.
This way, it makes files in sub-directories look more natural; you'd pass in e.g. /boot/zImage rather than boot/zImage, which looks like a relative path.
PATCH 1/1 dfu: fix: Add the absolute path to the file name for ext4 write operation
Hi Stephen,
Quoted 6 lines · Lukasz Majewski
Quoted 4 lines
Commit
1151b7ac10b81ecbbhas cleaned up read and write operations. Unfortunately, for correct operation the write for ext4 fs requires absolute patch.
This patch fixes this case.
Quoted 6 lines
Shouldn't the user simply supply the absolute patch name as the entity name? That's what I've been doing.
This way, it makes files in sub-directories look more natural; you'd pass in e.g.
/boot/zImagerather than boot/zImage, which looks like a relative path.
Hmm.. this is the angle from which I didn't look.
Thanks for the tip. I will adjust envs accordingly. Please discard this patch.
Signature · 5 lines
Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
PATCH 1/1 dfu: fix: Add the absolute path to the file name for ext4 write operation
Quoted 11 lines · Lukasz Majewski
Hi Stephen,
Quoted 9 lines · Lukasz Majewski
Quoted 4 lines
Commit
1151b7ac10b81ecbbhas cleaned up read and write operations. Unfortunately, for correct operation the write for ext4 fs requires absolute patch.
This patch fixes this case.Shouldn't the user simply supply the absolute patch name as the entity name? That's what I've been doing.
Quoted 8 lines
Quoted 3 lines
This way, it makes files in sub-directories look more natural; you'd pass in e.g.
/boot/zImagerather than boot/zImage, which looks like a relative path.Hmm.. this is the angle from which I didn't look.
Thanks for the tip. I will adjust envs accordingly. Please discard this patch.
Done.
Best regards,
Marek Vasut