| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 if [ ! -f "${FLAGS_from}/chromiumos_test_image.bin" ] || \ | 108 if [ ! -f "${FLAGS_from}/chromiumos_test_image.bin" ] || \ |
| 109 [ ${FLAGS_force_copy} -eq ${FLAGS_TRUE} ] ; then | 109 [ ${FLAGS_force_copy} -eq ${FLAGS_TRUE} ] ; then |
| 110 # Copy it. | 110 # Copy it. |
| 111 echo "Creating test image from original..." | 111 echo "Creating test image from original..." |
| 112 cp -f "${SRC_IMAGE}" "${FLAGS_from}/chromiumos_test_image.bin" | 112 cp -f "${SRC_IMAGE}" "${FLAGS_from}/chromiumos_test_image.bin" |
| 113 | 113 |
| 114 # Check for manufacturing image. | 114 # Check for manufacturing image. |
| 115 if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ] ; then | 115 if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ] ; then |
| 116 FACTORY_ARGS="--factory" | 116 FACTORY_ARGS="--factory" |
| 117 fi | 117 fi |
| 118 # Check for yes | |
| 119 if [ ${FLAGS_yes} -eq ${FLAGS_TRUE} ] ; then | |
| 120 YES="--yes" | |
| 121 fi | |
| 122 | 118 |
| 123 | 119 # Modify it. Pass --yes so that mod_image_for_test.sh won't ask us if we |
| 124 # Modify it. | 120 # really want to modify the image; the user gave their assent already with |
| 121 # --test-image and the original image is going to be preserved. |
| 125 "${SCRIPTS_DIR}/mod_image_for_test.sh" --image \ | 122 "${SCRIPTS_DIR}/mod_image_for_test.sh" --image \ |
| 126 "${FLAGS_from}/chromiumos_test_image.bin" ${FACTORY_ARGS} ${YES} | 123 "${FLAGS_from}/chromiumos_test_image.bin" ${FACTORY_ARGS} --yes |
| 127 echo "Done with mod_image_for_test." | 124 echo "Done with mod_image_for_test." |
| 128 else | 125 else |
| 129 echo "Using cached test image." | 126 echo "Using cached test image." |
| 130 fi | 127 fi |
| 131 SRC_IMAGE="${FLAGS_from}/chromiumos_test_image.bin" | 128 SRC_IMAGE="${FLAGS_from}/chromiumos_test_image.bin" |
| 132 echo "Source test image is: ${SRC_IMAGE}" | 129 echo "Source test image is: ${SRC_IMAGE}" |
| 133 fi | 130 fi |
| 134 | 131 |
| 135 STATEFUL_DIR="${FLAGS_from}/stateful_partition" | 132 STATEFUL_DIR="${FLAGS_from}/stateful_partition" |
| 136 mkdir -p "${STATEFUL_DIR}" | 133 mkdir -p "${STATEFUL_DIR}" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 echo " sudo dd if=${FLAGS_to} of=/dev/sdb bs=4M" | 239 echo " sudo dd if=${FLAGS_to} of=/dev/sdb bs=4M" |
| 243 echo "where /dev/sdb is the entire keyfob." | 240 echo "where /dev/sdb is the entire keyfob." |
| 244 if [ ${INSIDE_CHROOT} -eq 1 ] | 241 if [ ${INSIDE_CHROOT} -eq 1 ] |
| 245 then | 242 then |
| 246 example=$(basename "${FLAGS_to}") | 243 example=$(basename "${FLAGS_to}") |
| 247 echo "NOTE: Since you are currently inside the chroot, and you'll need to" | 244 echo "NOTE: Since you are currently inside the chroot, and you'll need to" |
| 248 echo "run dd outside the chroot, the path to the USB image will be" | 245 echo "run dd outside the chroot, the path to the USB image will be" |
| 249 echo "different (ex: ~/chromeos/trunk/src/build/images/SOME_DIR/$example)." | 246 echo "different (ex: ~/chromeos/trunk/src/build/images/SOME_DIR/$example)." |
| 250 fi | 247 fi |
| 251 fi | 248 fi |
| OLD | NEW |