| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 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 VMware image and write a | 7 # Script to convert the output of build_image.sh to a VMware image and write a |
| 8 # corresponding VMware config file. | 8 # corresponding VMware config file. |
| 9 | 9 |
| 10 # Load common constants. This should be the first executable line. | 10 # Load common constants. This should be the first executable line. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 173 |
| 174 TEMP_MNT=$(mktemp -d) | 174 TEMP_MNT=$(mktemp -d) |
| 175 TEMP_ESP_MNT=$(mktemp -d) | 175 TEMP_ESP_MNT=$(mktemp -d) |
| 176 cleanup() { | 176 cleanup() { |
| 177 sudo umount -d "${TEMP_MNT}" | 177 sudo umount -d "${TEMP_MNT}" |
| 178 sudo umount -d "${TEMP_ESP_MNT}" | 178 sudo umount -d "${TEMP_ESP_MNT}" |
| 179 rmdir "${TEMP_MNT}" "${TEMP_ESP_MNT}" | 179 rmdir "${TEMP_MNT}" "${TEMP_ESP_MNT}" |
| 180 } | 180 } |
| 181 trap cleanup INT TERM EXIT | 181 trap cleanup INT TERM EXIT |
| 182 mkdir -p "${TEMP_MNT}" | 182 mkdir -p "${TEMP_MNT}" |
| 183 enable_rw_mount "${TEMP_ROOTFS}" |
| 183 sudo mount -o loop "${TEMP_ROOTFS}" "${TEMP_MNT}" | 184 sudo mount -o loop "${TEMP_ROOTFS}" "${TEMP_MNT}" |
| 184 mkdir -p "${TEMP_ESP_MNT}" | 185 mkdir -p "${TEMP_ESP_MNT}" |
| 185 sudo mount -o loop "${TEMP_ESP}" "${TEMP_ESP_MNT}" | 186 sudo mount -o loop "${TEMP_ESP}" "${TEMP_ESP_MNT}" |
| 186 | 187 |
| 187 if [ "${FLAGS_format}" = "qemu" ]; then | 188 if [ "${FLAGS_format}" = "qemu" ]; then |
| 188 sudo python "$(dirname $0)/fixup_image_for_qemu.py" \ | 189 sudo python "$(dirname $0)/fixup_image_for_qemu.py" \ |
| 189 --mounted_dir="${TEMP_MNT}" \ | 190 --mounted_dir="${TEMP_MNT}" \ |
| 190 --enable_tablet=true | 191 --enable_tablet=true |
| 191 else | 192 else |
| 192 sudo python "$(dirname $0)/fixup_image_for_qemu.py" \ | 193 sudo python "$(dirname $0)/fixup_image_for_qemu.py" \ |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 echo "${VMX_CONFIG}" | 278 echo "${VMX_CONFIG}" |
| 278 fi | 279 fi |
| 279 | 280 |
| 280 | 281 |
| 281 if [ "${FLAGS_format}" == "qemu" ]; then | 282 if [ "${FLAGS_format}" == "qemu" ]; then |
| 282 echo "If you have qemu-kvm installed, you can start the image by:" | 283 echo "If you have qemu-kvm installed, you can start the image by:" |
| 283 echo "sudo kvm -m ${FLAGS_mem} -vga std -pidfile /tmp/kvm.pid -net nic,model=e
1000 " \ | 284 echo "sudo kvm -m ${FLAGS_mem} -vga std -pidfile /tmp/kvm.pid -net nic,model=e
1000 " \ |
| 284 "-net user,hostfwd=tcp::922-:22 \\" | 285 "-net user,hostfwd=tcp::922-:22 \\" |
| 285 echo " -hda ${FLAGS_to}/${DEFAULT_QEMU_IMAGE}" | 286 echo " -hda ${FLAGS_to}/${DEFAULT_QEMU_IMAGE}" |
| 286 fi | 287 fi |
| OLD | NEW |