
On Sat, Jun 27, 2020 at 11:15:49AM +0800, John Chau wrote:
From: John Chau john@harmon.hk
This patch adds a feature for block device cloning similar to dd command, this should be useful for boot-strapping a device where usb gadget or networking is not available. For instance one can clone a factory image into a blank emmc from an external sd card.
Signed-off-by: John Chau john@harmon.hk
In general, checkpatch.pl complains a lot and those need to be fixed.
[snip]
+config CMD_CLONE
- bool "clone"
- depends on BLK
- select CLONE
There's no "config CLONE" so we don't need this line.
[snip]
+//FIXME: we assume blk size of both devices can be divided by 1M, which should be normal +#define BUFSIZE (1 * 1024 * 1024)
Can we do some run-time checks of the block sizes of each device and confirm this assumption and fail if it's not true?
Finally, we should also enable this on sandbox so that it's build-tested and put through coverity. Thanks!