image_to_vm.sh: use dd conv=sparse to copy partitions.

After writing lots of data to the output block device, the kernel will
sometimes hang in close.  See also http://b/135292499.

When the destination is not a regular file, cp ignores --sparse.  Since
the copies are to partitions in a loopback block device that was freshly
created, there is no need to write the zero blocks to it.

BUG=chromium:957712
TEST=manual

Change-Id: I884eb143d9cc2303e7855e78995a6c836b095f2b
Reviewed-on: https://chromium-review.googlesource.com/1661975
Tested-by: LaMont Jones <lamontjones@chromium.org>
Commit-Ready: LaMont Jones <lamontjones@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
1 file changed