[oe-commits] [openembedded-core] 12/20: ddimage: if 'pv' is installed, use it

git at git.openembedded.org git at git.openembedded.org
Fri Apr 29 11:12:04 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 0e2ff26a47b056913764c5867bd0d6f39f65ab19
Author: Christopher Larson <chris_larson at mentor.com>
AuthorDate: Mon Apr 25 21:56:18 2016 -0700

    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 at mentor.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 scripts/contrib/ddimage | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/contrib/ddimage b/scripts/contrib/ddimage
index a503f11..ab92995 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

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list