@@ -155,12 +155,14 @@ validate_checksum "$image_sum_file" "$image_path"
155
155
156
156
# Copy the image to make a fresh volume. We expand the image to increase from 2G
157
157
# to a usable size.
158
+ echo " + Copying and resizing root volume"
158
159
cp " $image_path " " $volume_file "
159
160
qemu-img resize " $volume_file " +10G
160
161
161
162
# Generate an SSH key if one doesn't exist.
162
163
ssh_key_path=" $persistent_dir /id_ed25519"
163
164
if [ ! -e " $ssh_key_path " ]; then
165
+ echo " + Generating SSH key file"
164
166
ssh-keygen -t ed25519 -f " $ssh_key_path " -C " exectrace+test@coder.com" -q -N " "
165
167
fi
166
168
@@ -181,8 +183,14 @@ users:
181
183
EOF
182
184
183
185
# Compile cloud-init config into a seed volume.
184
- cloudinit_seed_file=" $( mktemp --suffix=.exectrace.cloud_init_seed.img) "
185
- cloud-localds -v --disk-format raw -f vfat " $cloudinit_seed_file " cloud_init.cfg
186
+ echo " + Creating cloud-init seed file"
187
+ cloudinit_seed_file=" $temp_dir /cloud_init_seed.img"
188
+ cloud-localds \
189
+ -v \
190
+ --disk-format raw \
191
+ --filesystem iso9660 \
192
+ " $cloudinit_seed_file " \
193
+ cloud_init.cfg
186
194
187
195
# Prepare arguments for qemu.
188
196
pid_file=" ./qemu.pid"
@@ -202,6 +210,7 @@ qemu_args=(
202
210
-monitor " unix:$monitor_socket ,server,nowait"
203
211
)
204
212
if [[ " $( uname -m) " == " $arch " ]] || [[ " $( uname -m) " == " $vm_arch " ]]; then
213
+ echo " + Enabling KVM"
205
214
qemu_args+=(
206
215
--enable-kvm
207
216
-cpu host
217
226
218
227
# Arm requires EFI.
219
228
if [[ " $arch " == * arm* ]]; then
229
+ echo " + Enabling EFI (due to arm requirement)"
220
230
dd if=/dev/zero of=flash0.img bs=1M count=64
221
231
dd if=/usr/share/qemu-efi/QEMU_EFI.fd of=flash0.img conv=notrunc
222
232
dd if=/dev/zero of=flash1.img bs=1M count=64
230
240
log_file=" $( mktemp --tmpdir tmp.exectrace-qemu.XXXXX.log) "
231
241
echoerr " Starting qemu with log file '$log_file '"
232
242
echoerr " QEMU monitor will be available at '$monitor_socket '"
233
- # nohup sudo "qemu-system-$vm_arch" "${qemu_args[@]}" &>"$log_file" & disown
234
- sudo " qemu-system-$vm_arch " " ${qemu_args[@]} "
243
+ nohup sudo " qemu-system-$vm_arch " " ${qemu_args[@]} " & > " $log_file " & disown
235
244
sleep 5
236
245
237
246
dump_log () {
@@ -355,7 +364,7 @@ if [[ "\$(uname -r)" != *"$kernel_image_pkg_name"* ]]; then
355
364
fi
356
365
357
366
# shellcheck disable=SC2088 # intentionally don't want ~ to expand by using "
358
- "~/ $test_binary " -test.v -test.timeout=10m
367
+ ~/" $test_binary " -test.v -test.timeout=10m
359
368
EOF
360
369
361
370
xssh poweroff || true
0 commit comments