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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 echo "that is not visible from inside the chroot. Please unmount the " | 207 echo "that is not visible from inside the chroot. Please unmount the " |
208 echo "device manually from outside the chroot and try again." | 208 echo "device manually from outside the chroot and try again." |
209 echo | 209 echo |
210 exit 1 | 210 exit 1 |
211 fi | 211 fi |
212 done | 212 done |
213 sleep 3 | 213 sleep 3 |
214 | 214 |
215 echo "Copying ${SRC_IMAGE} to ${FLAGS_to}..." | 215 echo "Copying ${SRC_IMAGE} to ${FLAGS_to}..." |
216 sudo dd if="${SRC_IMAGE}" of="${FLAGS_to}" bs=4M | 216 sudo dd if="${SRC_IMAGE}" of="${FLAGS_to}" bs=4M |
| 217 sync |
217 | 218 |
218 echo "Done." | 219 echo "Done." |
219 else | 220 else |
220 # Output to a file, so just make a copy. | 221 # Output to a file, so just make a copy. |
221 echo "Copying ${SRC_IMAGE} to ${FLAGS_to}..." | 222 echo "Copying ${SRC_IMAGE} to ${FLAGS_to}..." |
222 cp -f "${SRC_IMAGE}" "${FLAGS_to}" | 223 cp -f "${SRC_IMAGE}" "${FLAGS_to}" |
223 | 224 |
224 echo "Done. To copy to a USB drive, outside the chroot, do something like:" | 225 echo "Done. To copy to a USB drive, outside the chroot, do something like:" |
225 echo " sudo dd if=${FLAGS_to} of=/dev/sdX bs=4M" | 226 echo " sudo dd if=${FLAGS_to} of=/dev/sdX bs=4M" |
226 echo "where /dev/sdX is the entire drive." | 227 echo "where /dev/sdX is the entire drive." |
227 if [ ${INSIDE_CHROOT} -eq 1 ] | 228 if [ ${INSIDE_CHROOT} -eq 1 ] |
228 then | 229 then |
229 example=$(basename "${FLAGS_to}") | 230 example=$(basename "${FLAGS_to}") |
230 echo "NOTE: Since you are currently inside the chroot, and you'll need to" | 231 echo "NOTE: Since you are currently inside the chroot, and you'll need to" |
231 echo "run dd outside the chroot, the path to the USB image will be" | 232 echo "run dd outside the chroot, the path to the USB image will be" |
232 echo "different (ex: ~/chromeos/trunk/src/build/images/SOME_DIR/$example)." | 233 echo "different (ex: ~/chromeos/trunk/src/build/images/SOME_DIR/$example)." |
233 fi | 234 fi |
234 fi | 235 fi |
OLD | NEW |