| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 --enable_tablet=true | 194 --enable_tablet=true |
| 195 else | 195 else |
| 196 sudo python "$(dirname $0)/fixup_image_for_qemu.py" \ | 196 sudo python "$(dirname $0)/fixup_image_for_qemu.py" \ |
| 197 --mounted_dir="${TEMP_MNT}" \ | 197 --mounted_dir="${TEMP_MNT}" \ |
| 198 --enable_tablet=false | 198 --enable_tablet=false |
| 199 fi | 199 fi |
| 200 | 200 |
| 201 # Modify the unverified usb template which uses a default usb_disk of sdb3 | 201 # Modify the unverified usb template which uses a default usb_disk of sdb3 |
| 202 sudo sed -i -e 's/sdb3/sda3/g' "${TEMP_MNT}/boot/syslinux/usb.A.cfg" | 202 sudo sed -i -e 's/sdb3/sda3/g' "${TEMP_MNT}/boot/syslinux/usb.A.cfg" |
| 203 | 203 |
| 204 # Force the usbserial_generic driver to recognize the QEMU usb serial device |
| 205 # The guest usb serial device is used to communicate with the QEMU monitor |
| 206 sudo sed -i -e \ |
| 207 's/^.*append.*/& usbserial.vendor=0x0403 usbserial.product=0x6001/' \ |
| 208 "${TEMP_MNT}/boot/syslinux/usb.A.cfg" |
| 209 |
| 204 # Unmount everything prior to building a final image | 210 # Unmount everything prior to building a final image |
| 205 sync | 211 sync |
| 206 trap - INT TERM EXIT | 212 trap - INT TERM EXIT |
| 207 cleanup | 213 cleanup |
| 208 | 214 |
| 209 # TOOD(adlr): pick a size that will for sure accomodate the partitions. | 215 # TOOD(adlr): pick a size that will for sure accomodate the partitions. |
| 210 dd if=/dev/zero of="${TEMP_IMG}" bs=1 count=1 \ | 216 dd if=/dev/zero of="${TEMP_IMG}" bs=1 count=1 \ |
| 211 seek=$((${FLAGS_vdisk_size} * 1024 * 1024 - 1)) | 217 seek=$((${FLAGS_vdisk_size} * 1024 * 1024 - 1)) |
| 212 | 218 |
| 213 GPT_FULL="false" | 219 GPT_FULL="false" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 echo "${VMX_CONFIG}" | 287 echo "${VMX_CONFIG}" |
| 282 fi | 288 fi |
| 283 | 289 |
| 284 | 290 |
| 285 if [ "${FLAGS_format}" == "qemu" ]; then | 291 if [ "${FLAGS_format}" == "qemu" ]; then |
| 286 echo "If you have qemu-kvm installed, you can start the image by:" | 292 echo "If you have qemu-kvm installed, you can start the image by:" |
| 287 echo "sudo kvm -m ${FLAGS_mem} -vga std -pidfile /tmp/kvm.pid -net nic,model=e
1000 " \ | 293 echo "sudo kvm -m ${FLAGS_mem} -vga std -pidfile /tmp/kvm.pid -net nic,model=e
1000 " \ |
| 288 "-net user,hostfwd=tcp::9222-:22 \\" | 294 "-net user,hostfwd=tcp::9222-:22 \\" |
| 289 echo " -hda ${FLAGS_to}/${DEFAULT_QEMU_IMAGE}" | 295 echo " -hda ${FLAGS_to}/${DEFAULT_QEMU_IMAGE}" |
| 290 fi | 296 fi |
| OLD | NEW |