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:31:15 +0100 |
commit | 6e4b81777690a06a12a70e6dfc9fcac59dabe9f1 (patch) | |
tree | c9d6bb3212f26fdf50892bf531906be117f6fc68 /scripts | |
parent | 6ebe903f1aed3002ba43419a312c84bfbd1288dd (diff) | |
download | poky-6e4b81777690a06a12a70e6dfc9fcac59dabe9f1.tar.gz |
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>
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 | |||
100 | fi | 100 | fi |
101 | 101 | ||
102 | echo "Writing image..." | 102 | echo "Writing image..." |
103 | dd if="$IMAGE" of="$DEVICE" bs="$BLOCKSIZE" | 103 | if which pv >/dev/null 2>&1; then |
104 | pv "$IMAGE" | dd of="$DEVICE" bs="$BLOCKSIZE" | ||
105 | else | ||
106 | dd if="$IMAGE" of="$DEVICE" bs="$BLOCKSIZE" | ||
107 | fi | ||
104 | sync | 108 | sync |