From 4ad855540f183d4ce39e57f3e1b6f6bc006cae95 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 9 Oct 2022 11:40:31 +0000 Subject: host/start-vm: support multiple block devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the first step to being able to do things like having a static base image for an application VM, and another image containing the application to run. When we actually use multiple images we'll need to change how we boot so we know the kernel is booting from the right image — probably by PARTUUID or PARTLABEL — because we can't guarantee how the kernel orders disks inside the VM. Signed-off-by: Alyssa Ross Message-Id: <20221009114036.463071-2-hi@alyssa.is> --- vm/app/catgirl/Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'vm/app/catgirl') diff --git a/vm/app/catgirl/Makefile b/vm/app/catgirl/Makefile index a32826b..9016745 100644 --- a/vm/app/catgirl/Makefile +++ b/vm/app/catgirl/Makefile @@ -12,7 +12,7 @@ VMM = qemu HOST_FILES = host/data/appvm-catgirl/providers/net/netvm HOST_BUILD_FILES = \ - build/host/data/appvm-catgirl/rootfs.ext4 \ + build/host/data/appvm-catgirl/blk/root.img \ build/host/data/appvm-catgirl/vmlinux # We produce a directory, but that doesn't play nice with Make, @@ -35,7 +35,7 @@ build/host/data/appvm-catgirl/vmlinux: $(VMLINUX) # tar2ext4 will leave half a filesystem behind if it's interrupted # half way through. -build/host/data/appvm-catgirl/rootfs.ext4: build/rootfs.tar +build/host/data/appvm-catgirl/blk/root.img: build/rootfs.tar mkdir -p $$(dirname $@) tar2ext4 -i build/rootfs.tar -o $@.tmp mv $@.tmp $@ @@ -92,9 +92,9 @@ build/etc/s6-rc: $(VM_S6_RC_FILES) s6-rc-compile $@ $$dir; \ exit=$$?; rm -r $$dir; exit $$exit -run-qemu: build/host/data/appvm-catgirl/rootfs.ext4 +run-qemu: build/host/data/appvm-catgirl/blk/root.img $(QEMU_KVM) -m 128 -cpu host -machine q35,kernel=$(KERNEL) -vga none \ - -drive file=build/host/data/appvm-catgirl/rootfs.ext4,if=virtio,format=raw,readonly=on \ + -drive file=build/host/data/appvm-catgirl/blk/root.img,if=virtio,format=raw,readonly=on \ -append "console=ttyS0 root=/dev/vda" \ -netdev user,id=net0 \ -device virtio-net,netdev=net0,mac=0A:B3:EC:00:00:00 \ @@ -103,11 +103,11 @@ run-qemu: build/host/data/appvm-catgirl/rootfs.ext4 -device virtconsole,chardev=virtiocon0 .PHONY: run-qemu -run-cloud-hypervisor: build/host/data/appvm-catgirl/rootfs.ext4 +run-cloud-hypervisor: build/host/data/appvm-catgirl/blk/root.img $(CLOUD_HYPERVISOR) \ --api-socket path=vmm.sock \ --memory size=128M \ - --disk path=build/host/data/appvm-catgirl/rootfs.ext4,readonly=on \ + --disk path=build/host/data/appvm-catgirl/blk/root.img,readonly=on \ --net tap=tap0,mac=0A:B3:EC:00:00:00 \ --kernel $(KERNEL) \ --cmdline "console=ttyS0 root=/dev/vda" \ -- cgit 1.4.1