[PATCH] cmd: add clone command

Tom Rini trini at konsulko.com
Mon Jun 29 17:54:41 CEST 2020


On Sat, Jun 27, 2020 at 11:15:49AM +0800, John Chau wrote:

> From: John Chau <john at 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 at 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!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200629/febaeda1/attachment.sig>


More information about the U-Boot mailing list