summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-10-10 23:28:53 +0000
committerAlyssa Ross <hi@alyssa.is>2022-11-13 23:59:04 +0000
commit87d1c2a5a5eff07b398135ee83f4299f09b83227 (patch)
tree72143c248ee5ab8ec28618da460f56690af9e8b4
parent8c350b7a74af65b0a08b024efde6f3b87732ffe7 (diff)
downloadspectrum-87d1c2a5a5eff07b398135ee83f4299f09b83227.tar
spectrum-87d1c2a5a5eff07b398135ee83f4299f09b83227.tar.gz
spectrum-87d1c2a5a5eff07b398135ee83f4299f09b83227.tar.bz2
spectrum-87d1c2a5a5eff07b398135ee83f4299f09b83227.tar.lz
spectrum-87d1c2a5a5eff07b398135ee83f4299f09b83227.tar.xz
spectrum-87d1c2a5a5eff07b398135ee83f4299f09b83227.tar.zst
spectrum-87d1c2a5a5eff07b398135ee83f4299f09b83227.zip
host/rootfs: use a bigger test ext partition
So that we can test things that write to disk.

Unlinking the file prior to starting the VM ensures that it won't
stick around once it's no longer needed.

I disable make's printing of the commands in favour of the shell's,
because the cp can take some time on filesystems that don't support
reflinks, and it's nice to see which command is currently running
rather than all of them at once as make would show.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Message-Id: <20221010232909.1953738-14-hi@alyssa.is>
-rw-r--r--host/rootfs/Makefile10
1 files changed, 8 insertions, 2 deletions
diff --git a/host/rootfs/Makefile b/host/rootfs/Makefile
index 31f76d2..9559c06 100644
--- a/host/rootfs/Makefile
+++ b/host/rootfs/Makefile
@@ -141,14 +141,20 @@ build/live.img: $(SCRIPTS)/format-uuid.sh $(SCRIPTS)/make-gpt.sh build/rootfs.ve
 	mv $@.tmp $@
 
 run: build/live.img $(EXT_FS) build/rootfs.verity.roothash
-	$(QEMU_KVM) -cpu host -m 2G \
+	@set -x && \
+	ext="$$(mktemp build/spectrum-rootfs-extfs.XXXXXXXXXX.img)" && \
+	cp $(EXT_FS) "$$ext" && \
+	exec 3<>"$$ext" && \
+	rm -f "$$ext" && \
+	truncate -s +10G /proc/self/fd/3 && \
+	exec $(QEMU_KVM) -cpu host -m 2G \
 	    -machine q35,kernel=$(KERNEL),kernel-irqchip=split,initrd=$(INITRAMFS) \
 	    -display gtk,gl=on \
 	    -qmp unix:vmm.sock,server,nowait \
 	    -monitor vc \
 	    -parallel none \
 	    -drive file=build/live.img,if=virtio,format=raw,readonly=on \
-	    -drive file=$(EXT_FS),if=virtio,format=raw,readonly=on \
+	    -drive file=/proc/self/fd/3,if=virtio,format=raw \
 	    -append "console=ttyS0 roothash=$$(< build/rootfs.verity.roothash) ext=/dev/vdb intel_iommu=on" \
 	    -device intel-iommu,intremap=on \
 	    -device virtio-vga-gl \