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

Unified Diff: lib/cros_image_common.sh

Issue 6261003: crosutils/make_factory_package.sh: support full SSD image as target outside chroot (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: Created 9 years, 11 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 | make_factory_package.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/cros_image_common.sh
diff --git a/lib/cros_image_common.sh b/lib/cros_image_common.sh
index abfdbc57c9bf7e50f70e2b042220b022c58eda67..b9e2802c09fa0e037bb94a24570fa486fc54ff4a 100644
--- a/lib/cros_image_common.sh
+++ b/lib/cros_image_common.sh
@@ -185,6 +185,16 @@ image_partition_copy() {
exit 1
fi
+ # Try to use larger buffer if offset/size can be re-aligned.
+ # 2M / 512 = 4096
+ local buffer_ratio=4096
+ local bs=512
+ if [ $((dstoffset % buffer_ratio)) -eq 0 -a \
+ $((length % buffer_ratio)) -eq 0 ]; then
+ dstoffset=$((dstoffset / buffer_ratio))
+ bs=$((bs * buffer_ratio))
+ fi
+
image_dump_partition "${src}" "${srcpart}" |
- dd of="${dst}" bs=512 seek="${dstoffset}" conv=notrunc
+ dd of="${dst}" bs="${bs}" seek="${dstoffset}" conv=notrunc oflag=dsync
}
« no previous file with comments | « no previous file | make_factory_package.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698