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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | make_factory_package.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 # This script contains common utility function to deal with disk images, 7 # This script contains common utility function to deal with disk images,
8 # especially for being redistributed into platforms without complete Chromium OS 8 # especially for being redistributed into platforms without complete Chromium OS
9 # developing environment. 9 # developing environment.
10 10
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 local srcoffset=$(image_part_offset "${src}" "${srcpart}") 179 local srcoffset=$(image_part_offset "${src}" "${srcpart}")
180 local dstoffset=$(image_part_offset "${dst}" "${dstpart}") 180 local dstoffset=$(image_part_offset "${dst}" "${dstpart}")
181 local length=$(image_part_size "${src}" "${srcpart}") 181 local length=$(image_part_size "${src}" "${srcpart}")
182 local dstlength=$(image_part_size "${dst}" "${dstpart}") 182 local dstlength=$(image_part_size "${dst}" "${dstpart}")
183 183
184 if [ "${length}" -gt "${dstlength}" ]; then 184 if [ "${length}" -gt "${dstlength}" ]; then
185 exit 1 185 exit 1
186 fi 186 fi
187 187
188 # Try to use larger buffer if offset/size can be re-aligned.
189 # 2M / 512 = 4096
190 local buffer_ratio=4096
191 local bs=512
192 if [ $((dstoffset % buffer_ratio)) -eq 0 -a \
193 $((length % buffer_ratio)) -eq 0 ]; then
194 dstoffset=$((dstoffset / buffer_ratio))
195 bs=$((bs * buffer_ratio))
196 fi
197
188 image_dump_partition "${src}" "${srcpart}" | 198 image_dump_partition "${src}" "${srcpart}" |
189 dd of="${dst}" bs=512 seek="${dstoffset}" conv=notrunc 199 dd of="${dst}" bs="${bs}" seek="${dstoffset}" conv=notrunc oflag=dsync
190 } 200 }
OLDNEW
« 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