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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 # If we're asked to modify the image for test, then let's make a copy and | 90 # If we're asked to modify the image for test, then let's make a copy and |
91 # modify that instead. | 91 # modify that instead. |
92 if [ ${FLAGS_test_image} -eq ${FLAGS_TRUE} ] ; then | 92 if [ ${FLAGS_test_image} -eq ${FLAGS_TRUE} ] ; then |
93 if [ ! -f "${FLAGS_from}/chromiumos_test_image.bin" ] ; then | 93 if [ ! -f "${FLAGS_from}/chromiumos_test_image.bin" ] ; then |
94 # Copy it. | 94 # Copy it. |
95 echo "Creating test image from original..." | 95 echo "Creating test image from original..." |
96 cp -f "${SRC_IMAGE}" "${FLAGS_from}/chromiumos_test_image.bin" | 96 cp -f "${SRC_IMAGE}" "${FLAGS_from}/chromiumos_test_image.bin" |
97 # Modify it. | 97 # Modify it. |
98 "${SCRIPTS_DIR}/mod_image_for_test.sh" --image \ | 98 "${SCRIPTS_DIR}/mod_image_for_test.sh" --image \ |
99 "${FLAGS_from}/chromiumos_test_image.bin" | 99 "${FLAGS_from}/chromiumos_test_image.bin" --yes |
100 fi | 100 fi |
101 # Use it. | 101 # Use it. |
102 SRC_IMAGE="${FLAGS_from}/chromiumos_test_image.bin" | 102 SRC_IMAGE="${FLAGS_from}/chromiumos_test_image.bin" |
103 fi | 103 fi |
104 | 104 |
105 STATEFUL_DIR="${FLAGS_from}/stateful_partition" | 105 STATEFUL_DIR="${FLAGS_from}/stateful_partition" |
106 mkdir -p "${STATEFUL_DIR}" | 106 mkdir -p "${STATEFUL_DIR}" |
107 | 107 |
108 function do_cleanup { | 108 function do_cleanup { |
109 echo "Cleaning loopback devices: ${STATEFUL_LOOP_DEV}" | 109 echo "Cleaning loopback devices: ${STATEFUL_LOOP_DEV}" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 echo " sudo dd if=${FLAGS_to} of=/dev/sdb bs=4M" | 210 echo " sudo dd if=${FLAGS_to} of=/dev/sdb bs=4M" |
211 echo "where /dev/sdb is the entire keyfob." | 211 echo "where /dev/sdb is the entire keyfob." |
212 if [ ${INSIDE_CHROOT} -eq 1 ] | 212 if [ ${INSIDE_CHROOT} -eq 1 ] |
213 then | 213 then |
214 example=$(basename "${FLAGS_to}") | 214 example=$(basename "${FLAGS_to}") |
215 echo "NOTE: Since you are currently inside the chroot, and you'll need to" | 215 echo "NOTE: Since you are currently inside the chroot, and you'll need to" |
216 echo "run dd outside the chroot, the path to the USB image will be" | 216 echo "run dd outside the chroot, the path to the USB image will be" |
217 echo "different (ex: ~/chromeos/trunk/src/build/images/SOME_DIR/$example)." | 217 echo "different (ex: ~/chromeos/trunk/src/build/images/SOME_DIR/$example)." |
218 fi | 218 fi |
219 fi | 219 fi |
OLD | NEW |