- sprintf(cmd_buf, "fat%s mmc %d:%d 0x%x %s %lx",
- op == DFU_OP_READ ? "load" : "write",
- dfu->data.mmc.dev, dfu->data.mmc.part,
- (unsigned int) buf, dfu->name, *len);
+ switch (dfu->layout) {
+ case DFU_FS_FAT:
+ sprintf(cmd_buf, "fat%s mmc %d:%d 0x%x %s %lx",
+ op == DFU_OP_READ ? "load" : "write",
+ dfu->data.mmc.dev, dfu->data.mmc.part,
+ (unsigned int) buf, dfu->name, *len);
+ break;
+ case DFU_FS_EXT4:
+ sprintf(cmd_buf, "ext4%s mmc %d:%d /%s 0x%x %ld",
+ op == DFU_OP_READ ? "load" : "write",
+ dfu->data.mmc.dev, dfu->data.mmc.part,
+ dfu->name, (unsigned int) buf, *len);
+ break;
+ default:
+ printf("%s: Layout (%s) not (yet) supported!\n", __func__,
+ dfu_get_layout(dfu->layout));
+ }