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

Side by Side Diff: lib/cros_image_common.sh

Issue 6050006: Allow disk image target for copy machine. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: . Created 9 years, 12 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 "$file" \ 161 "$file" \
162 "$mount_point" 162 "$mount_point"
163 } 163 }
164 164
165 # Unmounts a partition mount point by mount_partition 165 # Unmounts a partition mount point by mount_partition
166 image_umount_partition() { 166 image_umount_partition() {
167 local mount_point="$1" 167 local mount_point="$1"
168 168
169 umount -d "$mount_point" 169 umount -d "$mount_point"
170 } 170 }
171
172 # Copy a partition from one image to another.
173 image_partition_copy() {
174 local src="$1"
175 local srcpart="$2"
176 local dst="$3"
177 local dstpart="$4"
178
179 local srcoffset=$(image_part_offset "${src}" "${srcpart}")
180 local dstoffset=$(image_part_offset "${dst}" "${dstpart}")
181 local length=$(image_part_size "${src}" "${srcpart}")
182 local dstlength=$(image_part_size "${dst}" "${dstpart}")
183
184 if [ "${length}" -gt "${dstlength}" ]; then
185 exit 1
186 fi
187
188 image_dump_partition "${src}" "${srcpart}" |
189 dd of="${dst}" bs=512 seek="${dstoffset}" conv=notrunc
190 }
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