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 # --- BEGIN COMMON.SH BOILERPLATE --- | 10 # --- BEGIN COMMON.SH BOILERPLATE --- |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 sudo umount -d "${TEMP_ESP_MNT}" | 182 sudo umount -d "${TEMP_ESP_MNT}" |
183 rmdir "${TEMP_MNT}" "${TEMP_ESP_MNT}" | 183 rmdir "${TEMP_MNT}" "${TEMP_ESP_MNT}" |
184 } | 184 } |
185 trap cleanup INT TERM EXIT | 185 trap cleanup INT TERM EXIT |
186 mkdir -p "${TEMP_MNT}" | 186 mkdir -p "${TEMP_MNT}" |
187 enable_rw_mount "${TEMP_ROOTFS}" | 187 enable_rw_mount "${TEMP_ROOTFS}" |
188 sudo mount -o loop "${TEMP_ROOTFS}" "${TEMP_MNT}" | 188 sudo mount -o loop "${TEMP_ROOTFS}" "${TEMP_MNT}" |
189 mkdir -p "${TEMP_ESP_MNT}" | 189 mkdir -p "${TEMP_ESP_MNT}" |
190 sudo mount -o loop "${TEMP_ESP}" "${TEMP_ESP_MNT}" | 190 sudo mount -o loop "${TEMP_ESP}" "${TEMP_ESP_MNT}" |
191 | 191 |
| 192 sudo python "${SCRIPTS_DIR}/fixup_image_for_qemu.py" \ |
| 193 --mounted_dir="${TEMP_MNT}" |
| 194 |
192 # Modify the unverified usb template which uses a default usb_disk of sdb3 | 195 # Modify the unverified usb template which uses a default usb_disk of sdb3 |
193 sudo sed -i -e 's/sdb3/sda3/g' "${TEMP_MNT}/boot/syslinux/usb.A.cfg" | 196 sudo sed -i -e 's/sdb3/sda3/g' "${TEMP_MNT}/boot/syslinux/usb.A.cfg" |
194 | 197 |
195 # Unmount everything prior to building a final image | 198 # Unmount everything prior to building a final image |
196 sync | 199 sync |
197 trap - INT TERM EXIT | 200 trap - INT TERM EXIT |
198 cleanup | 201 cleanup |
199 | 202 |
200 # TOOD(adlr): pick a size that will for sure accomodate the partitions. | 203 # TOOD(adlr): pick a size that will for sure accomodate the partitions. |
201 dd if=/dev/zero of="${TEMP_IMG}" bs=1 count=1 \ | 204 dd if=/dev/zero of="${TEMP_IMG}" bs=1 count=1 \ |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 echo "${VMX_CONFIG}" | 275 echo "${VMX_CONFIG}" |
273 fi | 276 fi |
274 | 277 |
275 | 278 |
276 if [ "${FLAGS_format}" == "qemu" ]; then | 279 if [ "${FLAGS_format}" == "qemu" ]; then |
277 echo "If you have qemu-kvm installed, you can start the image by:" | 280 echo "If you have qemu-kvm installed, you can start the image by:" |
278 echo "sudo kvm -m ${FLAGS_mem} -vga std -pidfile /tmp/kvm.pid -net nic,model=v
irtio " \ | 281 echo "sudo kvm -m ${FLAGS_mem} -vga std -pidfile /tmp/kvm.pid -net nic,model=v
irtio " \ |
279 "-net user,hostfwd=tcp::9222-:22 \\" | 282 "-net user,hostfwd=tcp::9222-:22 \\" |
280 echo " -hda ${FLAGS_to}/${DEFAULT_QEMU_IMAGE}" | 283 echo " -hda ${FLAGS_to}/${DEFAULT_QEMU_IMAGE}" |
281 fi | 284 fi |
OLD | NEW |