Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 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 |
| 5 | # found in the LICENSE file. |
| 6 | |
| 7 | # Script to convert the output of build_image.sh to a VMware image and write a |
| 8 | # corresponding VMware config file. |
| 9 | |
Greg Spencer | 798d75f | 2011-02-01 22:04:49 -0800 | [diff] [blame^] | 10 | # --- BEGIN COMMON.SH BOILERPLATE --- |
| 11 | # Load common CrOS utilities. Inside the chroot this file is installed in |
| 12 | # /usr/lib/crosutils. Outside the chroot we find it relative to the script's |
| 13 | # location. |
| 14 | find_common_sh() { |
| 15 | local common_paths=(/usr/lib/crosutils $(dirname "$(readlink -f "$0")")) |
| 16 | local path |
| 17 | |
| 18 | SCRIPT_ROOT= |
| 19 | for path in "${common_paths[@]}"; do |
| 20 | if [ -r "${path}/common.sh" ]; then |
| 21 | SCRIPT_ROOT=${path} |
| 22 | break |
| 23 | fi |
| 24 | done |
| 25 | } |
| 26 | |
| 27 | find_common_sh |
| 28 | . "${SCRIPT_ROOT}/common.sh" || (echo "Unable to load common.sh" && exit 1) |
| 29 | # --- END COMMON.SH BOILERPLATE --- |
| 30 | |
| 31 | # Need to be inside the chroot to load chromeos-common.sh |
| 32 | assert_inside_chroot |
| 33 | |
| 34 | # Load functions and constants for chromeos-install |
| 35 | . "/usr/lib/installer/chromeos-common.sh" || \ |
| 36 | die "Unable to load /usr/lib/installer/chromeos-common.sh" |
| 37 | |
| 38 | . "${SCRIPT_ROOT}/lib/cros_vm_constants.sh" || \ |
| 39 | die "Unable to load ${SCRIPT_ROOT}/lib/cros_vm_constants.sh" |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 40 | |
| 41 | get_default_board |
| 42 | |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 43 | # Flags |
| 44 | DEFINE_string board "${DEFAULT_BOARD}" \ |
| 45 | "Board for which the image was built" |
| 46 | DEFINE_boolean factory $FLAGS_FALSE \ |
| 47 | "Modify the image for manufacturing testing" |
| 48 | DEFINE_boolean factory_install $FLAGS_FALSE \ |
| 49 | "Modify the image for factory install shim" |
| 50 | DEFINE_boolean force_copy ${FLAGS_FALSE} "Always rebuild test image" |
| 51 | DEFINE_string format "qemu" \ |
| 52 | "Output format, either qemu, vmware or virtualbox" |
| 53 | DEFINE_string from "" \ |
| 54 | "Directory containing rootfs.image and mbr.image" |
Chris Sosa | cc09f84 | 2010-09-21 17:09:51 -0700 | [diff] [blame] | 55 | DEFINE_boolean full "${FLAGS_FALSE}" "Build full image with all partitions." |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 56 | DEFINE_boolean make_vmx ${FLAGS_TRUE} \ |
| 57 | "Create a vmx file for use with vmplayer (vmware only)." |
| 58 | DEFINE_integer mem "${DEFAULT_MEM}" \ |
| 59 | "Memory size for the vm config in MBs (vmware only)." |
| 60 | DEFINE_integer rootfs_partition_size 1024 \ |
| 61 | "rootfs parition size in MBs." |
| 62 | DEFINE_string state_image "" \ |
| 63 | "Stateful partition image (defaults to creating new statful partition)" |
Chris Masone | 7d04c7a | 2010-11-09 08:24:13 -0800 | [diff] [blame] | 64 | DEFINE_integer statefulfs_size 2048 \ |
Rahul Chaturvedi | e770e16 | 2010-07-15 00:35:11 +0530 | [diff] [blame] | 65 | "Stateful partition size in MBs." |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 66 | DEFINE_boolean test_image "${FLAGS_FALSE}" \ |
| 67 | "Copies normal image to chromiumos_test_image.bin, modifies it for test." |
| 68 | DEFINE_string to "" \ |
| 69 | "Destination folder for VM output file(s)" |
| 70 | DEFINE_string vbox_disk "${DEFAULT_VBOX_DISK}" \ |
| 71 | "Filename for the output disk (virtualbox only)." |
| 72 | DEFINE_integer vdisk_size 3072 \ |
| 73 | "virtual disk size in MBs." |
| 74 | DEFINE_string vmdk "${DEFAULT_VMDK}" \ |
| 75 | "Filename for the vmware disk image (vmware only)." |
| 76 | DEFINE_string vmx "${DEFAULT_VMX}" \ |
| 77 | "Filename for the vmware config (vmware only)." |
| 78 | |
| 79 | # Parse command line |
| 80 | FLAGS "$@" || exit 1 |
| 81 | eval set -- "${FLAGS_ARGV}" |
| 82 | |
| 83 | # Die on any errors. |
| 84 | set -e |
| 85 | |
| 86 | if [ -z "${FLAGS_board}" ] ; then |
| 87 | die "--board is required." |
| 88 | fi |
| 89 | |
Chris Sosa | cc09f84 | 2010-09-21 17:09:51 -0700 | [diff] [blame] | 90 | if [ "${FLAGS_full}" -eq "${FLAGS_TRUE}" ] && \ |
| 91 | ( [[ ${FLAGS_vdisk_size} < ${MIN_VDISK_SIZE_FULL} ]] || \ |
| 92 | [[ ${FLAGS_statefulfs_size} < ${MIN_STATEFUL_FS_SIZE_FULL} ]]); then |
Chris Sosa | 9fe00b9 | 2010-10-22 12:34:16 -0700 | [diff] [blame] | 93 | warn "Disk is too small for full, using minimum: vdisk size equal to \ |
| 94 | ${MIN_VDISK_SIZE_FULL} and statefulfs size equal to \ |
Chris Sosa | cc09f84 | 2010-09-21 17:09:51 -0700 | [diff] [blame] | 95 | ${MIN_STATEFUL_FS_SIZE_FULL}." |
Chris Sosa | 9fe00b9 | 2010-10-22 12:34:16 -0700 | [diff] [blame] | 96 | FLAGS_vdisk_size=${MIN_VDISK_SIZE_FULL} |
| 97 | FLAGS_statefulfs_size=${MIN_STATEFUL_FS_SIZE_FULL} |
Chris Sosa | cc09f84 | 2010-09-21 17:09:51 -0700 | [diff] [blame] | 98 | fi |
| 99 | |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 100 | IMAGES_DIR="${DEFAULT_BUILD_ROOT}/images/${FLAGS_board}" |
| 101 | # Default to the most recent image |
| 102 | if [ -z "${FLAGS_from}" ] ; then |
Chris Sosa | bd61304 | 2010-10-04 13:29:23 -0700 | [diff] [blame] | 103 | FLAGS_from="$(./get_latest_image.sh --board=${FLAGS_board})" |
Zelidrag Hornung | 42ca818 | 2010-07-12 18:08:44 -0700 | [diff] [blame] | 104 | else |
| 105 | pushd "${FLAGS_from}" && FLAGS_from=`pwd` && popd |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 106 | fi |
| 107 | if [ -z "${FLAGS_to}" ] ; then |
| 108 | FLAGS_to="${FLAGS_from}" |
| 109 | fi |
| 110 | |
| 111 | # Use this image as the source image to copy |
| 112 | SRC_IMAGE="${FLAGS_from}/chromiumos_image.bin" |
| 113 | |
| 114 | # If we're asked to modify the image for test, then let's make a copy and |
| 115 | # modify that instead. |
| 116 | if [ ${FLAGS_test_image} -eq ${FLAGS_TRUE} ] ; then |
| 117 | if [ ! -f "${FLAGS_from}/chromiumos_test_image.bin" ] || \ |
| 118 | [ ${FLAGS_force_copy} -eq ${FLAGS_TRUE} ] ; then |
| 119 | # Copy it. |
| 120 | echo "Creating test image from original..." |
| 121 | cp -f "${SRC_IMAGE}" "${FLAGS_from}/chromiumos_test_image.bin" |
| 122 | |
| 123 | # Check for manufacturing image. |
| 124 | if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ] ; then |
| 125 | EXTRA_ARGS="--factory" |
| 126 | fi |
| 127 | |
| 128 | # Check for install shim. |
| 129 | if [ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ] ; then |
| 130 | EXTRA_ARGS="--factory_install" |
| 131 | fi |
| 132 | |
| 133 | # Modify it. Pass --yes so that mod_image_for_test.sh won't ask us if we |
| 134 | # really want to modify the image; the user gave their assent already with |
| 135 | # --test-image and the original image is going to be preserved. |
Ryan Cairns | a7be5ff | 2010-08-23 20:47:07 -0700 | [diff] [blame] | 136 | "${SCRIPTS_DIR}/mod_image_for_test.sh" --board=${FLAGS_board} --image \ |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 137 | "${FLAGS_from}/chromiumos_test_image.bin" ${EXTRA_ARGS} --yes |
| 138 | echo "Done with mod_image_for_test." |
| 139 | else |
| 140 | echo "Using cached test image." |
| 141 | fi |
| 142 | SRC_IMAGE="${FLAGS_from}/chromiumos_test_image.bin" |
| 143 | echo "Source test image is: ${SRC_IMAGE}" |
| 144 | fi |
| 145 | |
| 146 | # Memory units are in MBs |
Greg Spencer | 798d75f | 2011-02-01 22:04:49 -0800 | [diff] [blame^] | 147 | TEMP_IMG="$(dirname "${SRC_IMAGE}")/vm_temp_image.bin" |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 148 | |
| 149 | # If we're not building for VMWare, don't build the vmx |
| 150 | if [ "${FLAGS_format}" != "vmware" ]; then |
| 151 | FLAGS_make_vmx="${FLAGS_FALSE}" |
| 152 | fi |
| 153 | |
| 154 | # Convert args to paths. Need eval to un-quote the string so that shell |
| 155 | # chars like ~ are processed; just doing FOO=`readlink -f $FOO` won't work. |
| 156 | FLAGS_from=`eval readlink -f $FLAGS_from` |
| 157 | FLAGS_to=`eval readlink -f $FLAGS_to` |
| 158 | |
| 159 | # Split apart the partitions and make some new ones |
| 160 | TEMP_DIR=$(mktemp -d) |
| 161 | (cd "${TEMP_DIR}" && |
| 162 | "${FLAGS_from}/unpack_partitions.sh" "${SRC_IMAGE}") |
| 163 | |
| 164 | # Fix the kernel command line |
| 165 | TEMP_ESP="${TEMP_DIR}"/part_12 |
| 166 | TEMP_ROOTFS="${TEMP_DIR}"/part_3 |
| 167 | TEMP_STATE="${TEMP_DIR}"/part_1 |
Will Drewry | efce668 | 2010-07-23 19:43:27 -0500 | [diff] [blame] | 168 | TEMP_KERN="${TEMP_DIR}"/part_2 |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 169 | if [ -n "${FLAGS_state_image}" ]; then |
| 170 | TEMP_STATE="${FLAGS_state_image}" |
Rahul Chaturvedi | e770e16 | 2010-07-15 00:35:11 +0530 | [diff] [blame] | 171 | else |
| 172 | # If we have a stateful fs size specified create a new state partition |
| 173 | # of the specified size. |
| 174 | if [ "${FLAGS_statefulfs_size}" -ne -1 ]; then |
| 175 | STATEFUL_SIZE_BYTES=$((1024 * 1024 * ${FLAGS_statefulfs_size})) |
| 176 | original_image_size=$(stat -c%s "${TEMP_STATE}") |
| 177 | if [ "${original_image_size}" -gt "${STATEFUL_SIZE_BYTES}" ]; then |
| 178 | die "Cannot resize stateful image to smaller than original. Exiting." |
| 179 | fi |
| 180 | |
| 181 | echo "Resizing stateful partition to ${FLAGS_statefulfs_size}MB" |
| 182 | STATEFUL_LOOP_DEV=$(sudo losetup -f) |
| 183 | if [ -z "${STATEFUL_LOOP_DEV}" ]; then |
| 184 | die "No free loop device. Free up a loop device or reboot. Exiting." |
| 185 | fi |
| 186 | |
| 187 | # Extend the original file size to the new size. |
| 188 | dd if=/dev/zero of="${TEMP_STATE}" bs=1 count=1 \ |
| 189 | seek=$((STATEFUL_SIZE_BYTES - 1)) |
| 190 | # Resize the partition. |
| 191 | sudo losetup "${STATEFUL_LOOP_DEV}" "${TEMP_STATE}" |
Chris Sosa | 020aa69 | 2010-10-08 16:36:20 -0700 | [diff] [blame] | 192 | sudo e2fsck -pf "${STATEFUL_LOOP_DEV}" |
Rahul Chaturvedi | e770e16 | 2010-07-15 00:35:11 +0530 | [diff] [blame] | 193 | sudo resize2fs "${STATEFUL_LOOP_DEV}" |
Chris Sosa | 1b11f38 | 2010-10-25 15:10:26 -0700 | [diff] [blame] | 194 | sync |
Rahul Chaturvedi | e770e16 | 2010-07-15 00:35:11 +0530 | [diff] [blame] | 195 | sudo losetup -d "${STATEFUL_LOOP_DEV}" |
| 196 | fi |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 197 | fi |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 198 | TEMP_PMBR="${TEMP_DIR}"/pmbr |
| 199 | dd if="${SRC_IMAGE}" of="${TEMP_PMBR}" bs=512 count=1 |
| 200 | |
| 201 | TEMP_MNT=$(mktemp -d) |
Will Drewry | efce668 | 2010-07-23 19:43:27 -0500 | [diff] [blame] | 202 | TEMP_ESP_MNT=$(mktemp -d) |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 203 | cleanup() { |
| 204 | sudo umount -d "${TEMP_MNT}" |
Will Drewry | efce668 | 2010-07-23 19:43:27 -0500 | [diff] [blame] | 205 | sudo umount -d "${TEMP_ESP_MNT}" |
| 206 | rmdir "${TEMP_MNT}" "${TEMP_ESP_MNT}" |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 207 | } |
| 208 | trap cleanup INT TERM EXIT |
| 209 | mkdir -p "${TEMP_MNT}" |
Will Drewry | f929c30 | 2010-10-20 18:48:20 -0500 | [diff] [blame] | 210 | enable_rw_mount "${TEMP_ROOTFS}" |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 211 | sudo mount -o loop "${TEMP_ROOTFS}" "${TEMP_MNT}" |
Will Drewry | efce668 | 2010-07-23 19:43:27 -0500 | [diff] [blame] | 212 | mkdir -p "${TEMP_ESP_MNT}" |
| 213 | sudo mount -o loop "${TEMP_ESP}" "${TEMP_ESP_MNT}" |
| 214 | |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 215 | if [ "${FLAGS_format}" = "qemu" ]; then |
Greg Spencer | 798d75f | 2011-02-01 22:04:49 -0800 | [diff] [blame^] | 216 | sudo python "${SCRIPTS_DIR}/fixup_image_for_qemu.py" \ |
Chris Sosa | cc09f84 | 2010-09-21 17:09:51 -0700 | [diff] [blame] | 217 | --mounted_dir="${TEMP_MNT}" \ |
| 218 | --enable_tablet=true |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 219 | else |
Greg Spencer | 798d75f | 2011-02-01 22:04:49 -0800 | [diff] [blame^] | 220 | sudo python "${SCRIPTS_DIR}/fixup_image_for_qemu.py" \ |
Chris Sosa | cc09f84 | 2010-09-21 17:09:51 -0700 | [diff] [blame] | 221 | --mounted_dir="${TEMP_MNT}" \ |
| 222 | --enable_tablet=false |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 223 | fi |
Will Drewry | 537caa9 | 2010-08-20 20:30:56 -0500 | [diff] [blame] | 224 | |
| 225 | # Modify the unverified usb template which uses a default usb_disk of sdb3 |
| 226 | sudo sed -i -e 's/sdb3/sda3/g' "${TEMP_MNT}/boot/syslinux/usb.A.cfg" |
| 227 | |
| 228 | # Unmount everything prior to building a final image |
Will Drewry | efce668 | 2010-07-23 19:43:27 -0500 | [diff] [blame] | 229 | sync |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 230 | trap - INT TERM EXIT |
| 231 | cleanup |
| 232 | |
Chris Sosa | cc09f84 | 2010-09-21 17:09:51 -0700 | [diff] [blame] | 233 | # TOOD(adlr): pick a size that will for sure accomodate the partitions. |
Will Drewry | 537caa9 | 2010-08-20 20:30:56 -0500 | [diff] [blame] | 234 | dd if=/dev/zero of="${TEMP_IMG}" bs=1 count=1 \ |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 235 | seek=$((${FLAGS_vdisk_size} * 1024 * 1024 - 1)) |
| 236 | |
Chris Sosa | cc09f84 | 2010-09-21 17:09:51 -0700 | [diff] [blame] | 237 | GPT_FULL="false" |
| 238 | [ "${FLAGS_full}" -eq "${FLAGS_TRUE}" ] && GPT_FULL="true" |
| 239 | |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 240 | # Set up the partition table |
Tan Gao | 0d5f948 | 2010-08-06 08:28:20 -0700 | [diff] [blame] | 241 | install_gpt "${TEMP_IMG}" "$(numsectors $TEMP_ROOTFS)" \ |
| 242 | "$(numsectors $TEMP_STATE)" "${TEMP_PMBR}" "$(numsectors $TEMP_ESP)" \ |
Chris Sosa | cc09f84 | 2010-09-21 17:09:51 -0700 | [diff] [blame] | 243 | "${GPT_FULL}" ${FLAGS_rootfs_partition_size} |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 244 | # Copy into the partition parts of the file |
| 245 | dd if="${TEMP_ROOTFS}" of="${TEMP_IMG}" conv=notrunc bs=512 \ |
| 246 | seek="${START_ROOTFS_A}" |
| 247 | dd if="${TEMP_STATE}" of="${TEMP_IMG}" conv=notrunc bs=512 \ |
| 248 | seek="${START_STATEFUL}" |
| 249 | dd if="${TEMP_KERN}" of="${TEMP_IMG}" conv=notrunc bs=512 \ |
| 250 | seek="${START_KERN_A}" |
| 251 | dd if="${TEMP_ESP}" of="${TEMP_IMG}" conv=notrunc bs=512 \ |
| 252 | seek="${START_ESP}" |
| 253 | |
Will Drewry | 537caa9 | 2010-08-20 20:30:56 -0500 | [diff] [blame] | 254 | # Make the built-image bootable and ensure that the legacy default usb boot |
| 255 | # uses /dev/sda instead of /dev/sdb3. |
| 256 | # NOTE: The TEMP_IMG must live in the same image dir as the original image |
| 257 | # to operate automatically below. |
| 258 | ${SCRIPTS_DIR}/bin/cros_make_image_bootable $(dirname "${TEMP_IMG}") \ |
| 259 | $(basename "${TEMP_IMG}") \ |
| 260 | --usb_disk /dev/sda3 |
| 261 | |
Rahul Chaturvedi | b5643e8 | 2010-07-09 10:46:05 +0530 | [diff] [blame] | 262 | echo Creating final image |
| 263 | # Convert image to output format |
| 264 | if [ "${FLAGS_format}" = "virtualbox" -o "${FLAGS_format}" = "qemu" ]; then |
| 265 | if [ "${FLAGS_format}" = "virtualbox" ]; then |
| 266 | VBoxManage convertdd "${TEMP_IMG}" "${FLAGS_to}/${FLAGS_vbox_disk}" |
| 267 | else |
| 268 | mv ${TEMP_IMG} ${FLAGS_to}/${DEFAULT_QEMU_IMAGE} |
| 269 | fi |
| 270 | elif [ "${FLAGS_format}" = "vmware" ]; then |
| 271 | qemu-img convert -f raw "${TEMP_IMG}" \ |
| 272 | -O vmdk "${FLAGS_to}/${FLAGS_vmdk}" |
| 273 | else |
| 274 | die "Invalid format: ${FLAGS_format}" |
| 275 | fi |
| 276 | |
| 277 | rm -rf "${TEMP_DIR}" "${TEMP_IMG}" |
| 278 | if [ -z "${FLAGS_state_image}" ]; then |
| 279 | rm -f "${STATE_IMAGE}" |
| 280 | fi |
| 281 | |
| 282 | echo "Created image at ${FLAGS_to}" |
| 283 | |
| 284 | # Generate the vmware config file |
| 285 | # A good reference doc: http://www.sanbarrow.com/vmx.html |
| 286 | VMX_CONFIG="#!/usr/bin/vmware |
| 287 | .encoding = \"UTF-8\" |
| 288 | config.version = \"8\" |
| 289 | virtualHW.version = \"4\" |
| 290 | memsize = \"${FLAGS_mem}\" |
| 291 | ide0:0.present = \"TRUE\" |
| 292 | ide0:0.fileName = \"${FLAGS_vmdk}\" |
| 293 | ethernet0.present = \"TRUE\" |
| 294 | usb.present = \"TRUE\" |
| 295 | sound.present = \"TRUE\" |
| 296 | sound.virtualDev = \"es1371\" |
| 297 | displayName = \"Chromium OS\" |
| 298 | guestOS = \"otherlinux\" |
| 299 | ethernet0.addressType = \"generated\" |
| 300 | floppy0.present = \"FALSE\"" |
| 301 | |
| 302 | if [[ "${FLAGS_make_vmx}" = "${FLAGS_TRUE}" ]]; then |
| 303 | echo "${VMX_CONFIG}" > "${FLAGS_to}/${FLAGS_vmx}" |
| 304 | echo "Wrote the following config to: ${FLAGS_to}/${FLAGS_vmx}" |
| 305 | echo "${VMX_CONFIG}" |
| 306 | fi |
| 307 | |
Olof Johansson | 3ed8d12 | 2010-09-27 13:29:40 -0500 | [diff] [blame] | 308 | |
| 309 | if [ "${FLAGS_format}" == "qemu" ]; then |
| 310 | echo "If you have qemu-kvm installed, you can start the image by:" |
Anush Elangovan | 0de6de6 | 2010-12-07 17:31:48 -0800 | [diff] [blame] | 311 | echo "sudo kvm -m ${FLAGS_mem} -vga std -pidfile /tmp/kvm.pid -net nic,model=virtio " \ |
Chris Masone | 7d04c7a | 2010-11-09 08:24:13 -0800 | [diff] [blame] | 312 | "-net user,hostfwd=tcp::9222-:22 \\" |
Olof Johansson | 3ed8d12 | 2010-09-27 13:29:40 -0500 | [diff] [blame] | 313 | echo " -hda ${FLAGS_to}/${DEFAULT_QEMU_IMAGE}" |
| 314 | fi |