Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: image_to_vm.sh

Issue 8726040: Added sudo to VBoxManage call, to fix permission denied error when building a VirtualBox image Base URL: http://git.chromium.org/chromiumos/platform/crosutils.git@master
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 # Helper scripts should be run from the same location as this script. 10 # Helper scripts should be run from the same location as this script.
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 # to operate automatically below. 198 # to operate automatically below.
199 ${SCRIPTS_DIR}/bin/cros_make_image_bootable $(dirname "${TEMP_IMG}") \ 199 ${SCRIPTS_DIR}/bin/cros_make_image_bootable $(dirname "${TEMP_IMG}") \
200 $(basename "${TEMP_IMG}") \ 200 $(basename "${TEMP_IMG}") \
201 --usb_disk /dev/sda3 \ 201 --usb_disk /dev/sda3 \
202 --force_developer_mode 202 --force_developer_mode
203 203
204 echo Creating final image 204 echo Creating final image
205 # Convert image to output format 205 # Convert image to output format
206 if [ "${FLAGS_format}" = "virtualbox" -o "${FLAGS_format}" = "qemu" ]; then 206 if [ "${FLAGS_format}" = "virtualbox" -o "${FLAGS_format}" = "qemu" ]; then
207 if [ "${FLAGS_format}" = "virtualbox" ]; then 207 if [ "${FLAGS_format}" = "virtualbox" ]; then
208 VBoxManage convertdd "${TEMP_IMG}" "${FLAGS_to}/${FLAGS_vbox_disk}" 208 sudo VBoxManage convertdd "${TEMP_IMG}" "${FLAGS_to}/${FLAGS_vbox_disk}"
209 else 209 else
210 mv ${TEMP_IMG} ${FLAGS_to}/${DEFAULT_QEMU_IMAGE} 210 mv ${TEMP_IMG} ${FLAGS_to}/${DEFAULT_QEMU_IMAGE}
211 fi 211 fi
212 elif [ "${FLAGS_format}" = "vmware" ]; then 212 elif [ "${FLAGS_format}" = "vmware" ]; then
213 qemu-img convert -f raw "${TEMP_IMG}" \ 213 qemu-img convert -f raw "${TEMP_IMG}" \
214 -O vmdk "${FLAGS_to}/${FLAGS_vmdk}" 214 -O vmdk "${FLAGS_to}/${FLAGS_vmdk}"
215 else 215 else
216 die "Invalid format: ${FLAGS_format}" 216 die "Invalid format: ${FLAGS_format}"
217 fi 217 fi
218 218
(...skipping 28 matching lines...) Expand all
247 echo "${VMX_CONFIG}" 247 echo "${VMX_CONFIG}"
248 fi 248 fi
249 249
250 250
251 if [ "${FLAGS_format}" == "qemu" ]; then 251 if [ "${FLAGS_format}" == "qemu" ]; then
252 echo "If you have qemu-kvm installed, you can start the image by:" 252 echo "If you have qemu-kvm installed, you can start the image by:"
253 echo "sudo kvm -m ${FLAGS_mem} -vga std -pidfile /tmp/kvm.pid -net nic,model=v irtio " \ 253 echo "sudo kvm -m ${FLAGS_mem} -vga std -pidfile /tmp/kvm.pid -net nic,model=v irtio " \
254 "-net user,hostfwd=tcp::9222-:22 \\" 254 "-net user,hostfwd=tcp::9222-:22 \\"
255 echo " -hda ${FLAGS_to}/${DEFAULT_QEMU_IMAGE}" 255 echo " -hda ${FLAGS_to}/${DEFAULT_QEMU_IMAGE}"
256 fi 256 fi
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698