Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: image_to_usb.sh

Issue 3608013: crosutils: refine image_to_usb progress output and performance (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git
Patch Set: remove trailing slash (by coding style guide) and add comments for why suppress dd report Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: image_to_usb.sh
diff --git a/image_to_usb.sh b/image_to_usb.sh
index 8248c393dee271ff0e2c6be2db1a5a1f37e8486c..19eefb1f63f6cb1ee95972984b0d17b18995aa63 100755
--- a/image_to_usb.sh
+++ b/image_to_usb.sh
@@ -237,7 +237,10 @@ then
if [ ${FLAGS_install} -ne ${FLAGS_TRUE} ]; then
echo "Copying ${SRC_IMAGE} to ${FLAGS_to}..."
if type pv >/dev/null 2>&1; then
- sudo pv -ptre "${SRC_IMAGE}" | sudo dd of="${FLAGS_to}" bs=4M oflag=sync
+ # pv displays file size in k=1024 while dd uses k=1000.
+ # To prevent confusion, we suppress the summary report from dd.
+ sudo pv -ptreb -B 4m "${SRC_IMAGE}" |
+ sudo dd of="${FLAGS_to}" bs=4M oflag=sync status=noxfer
else
sudo dd if="${SRC_IMAGE}" of="${FLAGS_to}" bs=4M oflag=sync
fi
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698