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

Side by Side Diff: image_to_vm.sh

Issue 3536018: Fixes for cbuild to work with ctest. (Closed) Base URL: http://git.chromium.org/git/crosutils.git
Patch Set: Fixes for petkov Created 10 years, 2 months 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 | Annotate | Revision Log
« no previous file with comments | « image_to_live.sh ('k') | run_remote_tests.sh » ('j') | 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 # Load common constants. This should be the first executable line. 10 # Load common constants. This should be the first executable line.
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 STATEFUL_LOOP_DEV=$(sudo losetup -f) 156 STATEFUL_LOOP_DEV=$(sudo losetup -f)
157 if [ -z "${STATEFUL_LOOP_DEV}" ]; then 157 if [ -z "${STATEFUL_LOOP_DEV}" ]; then
158 die "No free loop device. Free up a loop device or reboot. Exiting." 158 die "No free loop device. Free up a loop device or reboot. Exiting."
159 fi 159 fi
160 160
161 # Extend the original file size to the new size. 161 # Extend the original file size to the new size.
162 dd if=/dev/zero of="${TEMP_STATE}" bs=1 count=1 \ 162 dd if=/dev/zero of="${TEMP_STATE}" bs=1 count=1 \
163 seek=$((STATEFUL_SIZE_BYTES - 1)) 163 seek=$((STATEFUL_SIZE_BYTES - 1))
164 # Resize the partition. 164 # Resize the partition.
165 sudo losetup "${STATEFUL_LOOP_DEV}" "${TEMP_STATE}" 165 sudo losetup "${STATEFUL_LOOP_DEV}" "${TEMP_STATE}"
166 sudo e2fsck -f "${STATEFUL_LOOP_DEV}" 166 sudo e2fsck -pf "${STATEFUL_LOOP_DEV}"
167 sudo resize2fs "${STATEFUL_LOOP_DEV}" 167 sudo resize2fs "${STATEFUL_LOOP_DEV}"
168 sudo losetup -d "${STATEFUL_LOOP_DEV}" 168 sudo losetup -d "${STATEFUL_LOOP_DEV}"
169 fi 169 fi
170 fi 170 fi
171 TEMP_PMBR="${TEMP_DIR}"/pmbr 171 TEMP_PMBR="${TEMP_DIR}"/pmbr
172 dd if="${SRC_IMAGE}" of="${TEMP_PMBR}" bs=512 count=1 172 dd if="${SRC_IMAGE}" of="${TEMP_PMBR}" bs=512 count=1
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() {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 echo "${VMX_CONFIG}" 277 echo "${VMX_CONFIG}"
278 fi 278 fi
279 279
280 280
281 if [ "${FLAGS_format}" == "qemu" ]; then 281 if [ "${FLAGS_format}" == "qemu" ]; then
282 echo "If you have qemu-kvm installed, you can start the image by:" 282 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 " \ 283 echo "sudo kvm -m ${FLAGS_mem} -vga std -pidfile /tmp/kvm.pid -net nic " \
284 "-net user,hostfwd=tcp::922-:22 \\" 284 "-net user,hostfwd=tcp::922-:22 \\"
285 echo " -hda ${FLAGS_to}/${DEFAULT_QEMU_IMAGE}" 285 echo " -hda ${FLAGS_to}/${DEFAULT_QEMU_IMAGE}"
286 fi 286 fi
OLDNEW
« no previous file with comments | « image_to_live.sh ('k') | run_remote_tests.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698