diff options
author | Alyssa Ross <hi@alyssa.is> | 2022-10-09 11:40:31 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2022-11-13 23:58:25 +0000 |
commit | 4ad855540f183d4ce39e57f3e1b6f6bc006cae95 (patch) | |
tree | f51f213451fe6b6410f97a1e72f6b8cba0210502 /vm/sys/net/Makefile | |
parent | 435a82a9d09e6aaca27402a45756de1abd37437f (diff) | |
download | spectrum-4ad855540f183d4ce39e57f3e1b6f6bc006cae95.tar spectrum-4ad855540f183d4ce39e57f3e1b6f6bc006cae95.tar.gz spectrum-4ad855540f183d4ce39e57f3e1b6f6bc006cae95.tar.bz2 spectrum-4ad855540f183d4ce39e57f3e1b6f6bc006cae95.tar.lz spectrum-4ad855540f183d4ce39e57f3e1b6f6bc006cae95.tar.xz spectrum-4ad855540f183d4ce39e57f3e1b6f6bc006cae95.tar.zst spectrum-4ad855540f183d4ce39e57f3e1b6f6bc006cae95.zip |
host/start-vm: support multiple block devices
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 <hi@alyssa.is> Message-Id: <20221009114036.463071-2-hi@alyssa.is>
Diffstat (limited to 'vm/sys/net/Makefile')
-rw-r--r-- | vm/sys/net/Makefile | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vm/sys/net/Makefile b/vm/sys/net/Makefile index 7cb7a5f..0b5fe8f 100644 --- a/vm/sys/net/Makefile +++ b/vm/sys/net/Makefile @@ -10,7 +10,7 @@ CLOUD_HYPERVISOR = cloud-hypervisor VMM = qemu HOST_BUILD_FILES = \ - build/host/data/netvm/rootfs.ext4 \ + build/host/data/netvm/blk/root.img \ build/host/data/netvm/vmlinux # We produce a directory, but that doesn't play nice with Make, @@ -32,7 +32,7 @@ build/host/data/netvm/vmlinux: $(VMLINUX) # tar2ext4 will leave half a filesystem behind if it's interrupted # half way through. -build/host/data/netvm/rootfs.ext4: build/rootfs.tar +build/host/data/netvm/blk/root.img: build/rootfs.tar mkdir -p $$(dirname $@) tar2ext4 -i build/rootfs.tar -o $@.tmp mv $@.tmp $@ @@ -97,9 +97,9 @@ build/etc/s6-rc: $(VM_S6_RC_FILES) s6-rc-compile $@ $$dir; \ exit=$$?; rm -r $$dir; exit $$exit -run-qemu: build/host/data/netvm/rootfs.ext4 +run-qemu: build/host/data/netvm/blk/root.img $(QEMU_KVM) -m 128 -cpu host -machine q35,kernel=$(KERNEL) -vga none \ - -drive file=build/host/data/netvm/rootfs.ext4,if=virtio,format=raw,readonly=on \ + -drive file=build/host/data/netvm/blk/root.img,if=virtio,format=raw,readonly=on \ -append "console=ttyS0 root=/dev/vda" \ -netdev user,id=net0 \ -device e1000e,netdev=net0 \ @@ -110,11 +110,11 @@ run-qemu: build/host/data/netvm/rootfs.ext4 -device virtconsole,chardev=virtiocon0 .PHONY: run-qemu -run-cloud-hypervisor: build/host/data/netvm/rootfs.ext4 +run-cloud-hypervisor: build/host/data/netvm/blk/root.img $(CLOUD_HYPERVISOR) \ --api-socket path=vmm.sock \ --memory size=128M \ - --disk path=build/host/data/netvm/rootfs.ext4,readonly=on \ + --disk path=build/host/data/netvm/blk/root.img,readonly=on \ --net tap=tap0 tap=tap1,mac=0A:B3:EC:80:00:00 \ --kernel $(KERNEL) \ --cmdline "console=ttyS0 root=/dev/vda" \ |