ddimage: if 'pv' is installed, use it

This gives us a progress bar for the image write, which is quite helpful. See
https://www.ivarch.com/programs/pv.shtml.

(From OE-Core rev: 5b20cb2db929daaf0bf81c05368174e9c364ffab)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Christopher Larson 2016-04-25 21:56:18 -07:00 committed by Richard Purdie
parent 6ebe903f1a
commit 6e4b817776
1 changed files with 5 additions and 1 deletions

View File

@ -100,5 +100,9 @@ if [ "$RESPONSE" != "y" ]; then
fi
echo "Writing image..."
dd if="$IMAGE" of="$DEVICE" bs="$BLOCKSIZE"
if which pv >/dev/null 2>&1; then
pv "$IMAGE" | dd of="$DEVICE" bs="$BLOCKSIZE"
else
dd if="$IMAGE" of="$DEVICE" bs="$BLOCKSIZE"
fi
sync