From 87d1c2a5a5eff07b398135ee83f4299f09b83227 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 10 Oct 2022 23:28:53 +0000 Subject: 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 Message-Id: <20221010232909.1953738-14-hi@alyssa.is> --- host/rootfs/Makefile | 10 ++++++++-- 1 file 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 \ -- cgit 1.4.1