OLD | NEW |
---|---|
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 # Script to convert the output of build_image.sh to a usb image. | 7 # Script to convert the output of build_image.sh to a usb image. |
8 | 8 |
9 # Load common constants. This should be the first executable line. | 9 # Load common constants. This should be the first executable line. |
10 # The path to common.sh should be relative to your script's location. | 10 # The path to common.sh should be relative to your script's location. |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
229 echo "that is not visible from inside the chroot. Please unmount the " | 229 echo "that is not visible from inside the chroot. Please unmount the " |
230 echo "device manually from outside the chroot and try again." | 230 echo "device manually from outside the chroot and try again." |
231 echo | 231 echo |
232 exit 1 | 232 exit 1 |
233 fi | 233 fi |
234 done | 234 done |
235 sleep 3 | 235 sleep 3 |
236 | 236 |
237 if [ ${FLAGS_install} -ne ${FLAGS_TRUE} ]; then | 237 if [ ${FLAGS_install} -ne ${FLAGS_TRUE} ]; then |
238 echo "Copying ${SRC_IMAGE} to ${FLAGS_to}..." | 238 echo "Copying ${SRC_IMAGE} to ${FLAGS_to}..." |
239 sudo dd if="${SRC_IMAGE}" of="${FLAGS_to}" bs=4M | 239 if type pv >/dev/null 2>&1; then |
Kenneth Waters
2010/10/01 17:16:25
Remove this conditional, keep only the pv branch,
| |
240 sudo pv -ptre "${SRC_IMAGE}" | sudo dd of="${FLAGS_to}" bs=4M oflag=sync | |
241 else | |
242 sudo dd if="${SRC_IMAGE}" of="${FLAGS_to}" bs=4M oflag=sync | |
243 fi | |
240 sync | 244 sync |
241 else | 245 else |
242 if [ ${INSIDE_CHROOT} -ne 1 ]; then | 246 if [ ${INSIDE_CHROOT} -ne 1 ]; then |
243 echo "Installation must be done from inside the chroot." | 247 echo "Installation must be done from inside the chroot." |
244 exit 1 | 248 exit 1 |
245 fi | 249 fi |
246 | 250 |
247 echo "Installing ${SRC_IMAGE} to ${FLAGS_to}..." | 251 echo "Installing ${SRC_IMAGE} to ${FLAGS_to}..." |
248 "${FLAGS_build_root}/${FLAGS_board}/usr/sbin/chromeos-install" \ | 252 "${FLAGS_build_root}/${FLAGS_board}/usr/sbin/chromeos-install" \ |
249 --yes \ | 253 --yes \ |
(...skipping 13 matching lines...) Expand all Loading... | |
263 echo " sudo dd if=${FLAGS_to} of=/dev/sdX bs=4M" | 267 echo " sudo dd if=${FLAGS_to} of=/dev/sdX bs=4M" |
264 echo "where /dev/sdX is the entire drive." | 268 echo "where /dev/sdX is the entire drive." |
265 if [ ${INSIDE_CHROOT} -eq 1 ] | 269 if [ ${INSIDE_CHROOT} -eq 1 ] |
266 then | 270 then |
267 example=$(basename "${FLAGS_to}") | 271 example=$(basename "${FLAGS_to}") |
268 echo "NOTE: Since you are currently inside the chroot, and you'll need to" | 272 echo "NOTE: Since you are currently inside the chroot, and you'll need to" |
269 echo "run dd outside the chroot, the path to the USB image will be" | 273 echo "run dd outside the chroot, the path to the USB image will be" |
270 echo "different (ex: ~/chromeos/trunk/src/build/images/SOME_DIR/$example)." | 274 echo "different (ex: ~/chromeos/trunk/src/build/images/SOME_DIR/$example)." |
271 fi | 275 fi |
272 fi | 276 fi |
OLD | NEW |