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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 TEMP_MNT=$(mktemp -d) | 172 TEMP_MNT=$(mktemp -d) |
173 cleanup() { | 173 cleanup() { |
174 sudo umount -d "${TEMP_MNT}" | 174 sudo umount -d "${TEMP_MNT}" |
175 rmdir "${TEMP_MNT}" | 175 rmdir "${TEMP_MNT}" |
176 } | 176 } |
177 trap cleanup INT TERM EXIT | 177 trap cleanup INT TERM EXIT |
178 mkdir -p "${TEMP_MNT}" | 178 mkdir -p "${TEMP_MNT}" |
179 sudo mount -o loop "${TEMP_ROOTFS}" "${TEMP_MNT}" | 179 sudo mount -o loop "${TEMP_ROOTFS}" "${TEMP_MNT}" |
180 if [ "${FLAGS_format}" = "qemu" ]; then | 180 if [ "${FLAGS_format}" = "qemu" ]; then |
181 sudo python ./fixup_image_for_qemu.py --mounted_dir="${TEMP_MNT}" \ | 181 sudo python ./fixup_image_for_qemu.py --mounted_dir="${TEMP_MNT}" \ |
182 --for_qemu=true | 182 --enable_tablet=true |
183 else | 183 else |
184 sudo python ./fixup_image_for_qemu.py --mounted_dir="${TEMP_MNT}" \ | 184 sudo python ./fixup_image_for_qemu.py --mounted_dir="${TEMP_MNT}" \ |
185 --for_qemu=false | 185 --enable_tablet=false |
186 fi | 186 fi |
187 | 187 |
188 # Change this value if the rootfs partition changes | 188 # Change this value if the rootfs partition changes |
189 ROOTFS_PARTITION=/dev/sda3 | 189 ROOTFS_PARTITION=/dev/sda3 |
190 sudo "${TEMP_MNT}"/postinst_vm "${ROOTFS_PARTITION}" | 190 sudo "${TEMP_MNT}"/postinst "${ROOTFS_PARTITION}" --esp_part_file="${TEMP_ESP}" |
191 trap - INT TERM EXIT | 191 trap - INT TERM EXIT |
192 cleanup | 192 cleanup |
193 | 193 |
194 # Make 3 GiB output image | 194 # Make 3 GiB output image |
195 TEMP_IMG=$(mktemp) | 195 TEMP_IMG=$(mktemp) |
196 # TOOD(adlr): pick a size that will for sure accomodate the partitions | 196 # TOOD(adlr): pick a size that will for sure accomodate the partitions |
197 sudo dd if=/dev/zero of="${TEMP_IMG}" bs=1 count=1 \ | 197 sudo dd if=/dev/zero of="${TEMP_IMG}" bs=1 count=1 \ |
198 seek=$((${FLAGS_vdisk_size} * 1024 * 1024 - 1)) | 198 seek=$((${FLAGS_vdisk_size} * 1024 * 1024 - 1)) |
199 | 199 |
200 # Set up the partition table | 200 # Set up the partition table |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 guestOS = \"otherlinux\" | 249 guestOS = \"otherlinux\" |
250 ethernet0.addressType = \"generated\" | 250 ethernet0.addressType = \"generated\" |
251 floppy0.present = \"FALSE\"" | 251 floppy0.present = \"FALSE\"" |
252 | 252 |
253 if [[ "${FLAGS_make_vmx}" = "${FLAGS_TRUE}" ]]; then | 253 if [[ "${FLAGS_make_vmx}" = "${FLAGS_TRUE}" ]]; then |
254 echo "${VMX_CONFIG}" > "${FLAGS_to}/${FLAGS_vmx}" | 254 echo "${VMX_CONFIG}" > "${FLAGS_to}/${FLAGS_vmx}" |
255 echo "Wrote the following config to: ${FLAGS_to}/${FLAGS_vmx}" | 255 echo "Wrote the following config to: ${FLAGS_to}/${FLAGS_vmx}" |
256 echo "${VMX_CONFIG}" | 256 echo "${VMX_CONFIG}" |
257 fi | 257 fi |
258 | 258 |
OLD | NEW |