diff options
author | Christopher Larson <chris_larson@mentor.com> | 2016-04-25 21:56:18 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-06 10:30:59 +0100 |
commit | 5b20cb2db929daaf0bf81c05368174e9c364ffab (patch) | |
tree | dfe6e8d76dd9261f552a4bf411c3ab7d24f53bda /scripts | |
parent | a4b5076b2c06cafff0ce764955d0aa7c334c7a8e (diff) | |
download | openembedded-core-5b20cb2db929daaf0bf81c05368174e9c364ffab.tar.gz openembedded-core-5b20cb2db929daaf0bf81c05368174e9c364ffab.tar.bz2 openembedded-core-5b20cb2db929daaf0bf81c05368174e9c364ffab.zip |
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.
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/contrib/ddimage | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/contrib/ddimage b/scripts/contrib/ddimage index a503f11d0d..ab929957a5 100755 --- a/scripts/contrib/ddimage +++ b/scripts/contrib/ddimage @@ -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 |