Chromium Code Reviews| Index: image_to_vm.sh |
| diff --git a/image_to_vm.sh b/image_to_vm.sh |
| index dff302303f5caef887837550b14883efca73b17f..f37e39fa121aec80b921f0a39a2f20e0c7762b96 100755 |
| --- a/image_to_vm.sh |
| +++ b/image_to_vm.sh |
| @@ -64,7 +64,7 @@ DEFINE_string state_image "" \ |
| DEFINE_integer statefulfs_size 2048 \ |
| "Stateful partition size in MBs." |
| DEFINE_boolean test_image "${FLAGS_FALSE}" \ |
| - "Copies normal image to chromiumos_test_image.bin, modifies it for test." |
| + "Copies normal image to ${CHROMEOS_TEST_IMAGE_NAME}, modifies it for test." |
| DEFINE_string to "" \ |
| "Destination folder for VM output file(s)" |
| DEFINE_string vbox_disk "${DEFAULT_VBOX_DISK}" \ |
| @@ -108,39 +108,13 @@ if [ -z "${FLAGS_to}" ] ; then |
| FLAGS_to="${FLAGS_from}" |
| fi |
| -# Use this image as the source image to copy |
| -SRC_IMAGE="${FLAGS_from}/chromiumos_image.bin" |
| - |
| -# If we're asked to modify the image for test, then let's make a copy and |
| -# modify that instead. |
| if [ ${FLAGS_test_image} -eq ${FLAGS_TRUE} ] ; then |
| - if [ ! -f "${FLAGS_from}/chromiumos_test_image.bin" ] || \ |
| - [ ${FLAGS_force_copy} -eq ${FLAGS_TRUE} ] ; then |
| - # Copy it. |
| - echo "Creating test image from original..." |
| - cp -f "${SRC_IMAGE}" "${FLAGS_from}/chromiumos_test_image.bin" |
| - |
| - # Check for manufacturing image. |
| - if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ] ; then |
| - EXTRA_ARGS="--factory" |
| - fi |
| - |
| - # Check for install shim. |
| - if [ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ] ; then |
| - EXTRA_ARGS="--factory_install" |
| - fi |
| - |
| - # Modify it. Pass --yes so that mod_image_for_test.sh won't ask us if we |
| - # really want to modify the image; the user gave their assent already with |
| - # --test-image and the original image is going to be preserved. |
| - "${SCRIPTS_DIR}/mod_image_for_test.sh" --board=${FLAGS_board} --image \ |
| - "${FLAGS_from}/chromiumos_test_image.bin" ${EXTRA_ARGS} --yes |
| - echo "Done with mod_image_for_test." |
| - else |
| - echo "Using cached test image." |
| - fi |
| - SRC_IMAGE="${FLAGS_from}/chromiumos_test_image.bin" |
| - echo "Source test image is: ${SRC_IMAGE}" |
| + # Make a test image - this returns the test filename in CHROMEOS_RETURN_VAL |
| + prepare_test_image "${FLAGS_from}" "${CHROMEOS_IMAGE_NAME}" |
|
sosa
2011/02/09 02:58:52
Need to add FLAGS_force_copy=$FLAGS_TRUE here or a
|
| + SRC_IMAGE="${CHROMEOS_RETURN_VAL}" |
| +else |
| + # Use the standard image |
| + SRC_IMAGE="${FLAGS_from}/${CHROMEOS_IMAGE_NAME}" |
| fi |
| # Memory units are in MBs |
| @@ -308,7 +282,7 @@ fi |
| if [ "${FLAGS_format}" == "qemu" ]; then |
| echo "If you have qemu-kvm installed, you can start the image by:" |
| - echo "sudo kvm -m ${FLAGS_mem} -vga std -pidfile /tmp/kvm.pid -net nic,model=virtio " \ |
| + echo "sudo kvm -m ${FLAGS_mem} -vga std -pidfile /tmp/kvm.pid -net nic,model=e1000 " \ |
|
sosa
2011/02/09 02:58:52
This got accidentally reverted
|
| "-net user,hostfwd=tcp::9222-:22 \\" |
| echo " -hda ${FLAGS_to}/${DEFAULT_QEMU_IMAGE}" |
| fi |