From 5f556f806a70f3787fe725254ccf3d245bd5bebc Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 21 Nov 2023 14:38:35 +0100 Subject: vm: build command line into kernels The kernel command line is policy, and shouldn't be hardcoded in start-vm. We could add a mechanism for customising it at some point (this would probably be helpful for custom VMs), but we don't need that at the moment, since for our built-in VMs we're using custom-configured kernels anyway. Signed-off-by: Alyssa Ross --- img/app/Makefile | 4 +--- img/app/default.nix | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'img') diff --git a/img/app/Makefile b/img/app/Makefile index 8ac20c8..8137c48 100644 --- a/img/app/Makefile +++ b/img/app/Makefile @@ -104,7 +104,7 @@ run-qemu: $(imgdir)/appvm/blk/root.img start-virtiofsd @../../scripts/run-qemu.sh -m 128 -cpu host -kernel $(KERNEL) -vga none \ -drive file=$(imgdir)/appvm/blk/root.img,if=virtio,format=raw,readonly=on \ -drive file=$(RUN_IMG),if=virtio,format=raw,readonly=on \ - -append "root=PARTLABEL=root nokaslr" \ + -append nokaslr \ -gdb unix:build/gdb.sock,server,nowait \ -netdev user,id=net0 \ -device virtio-net,netdev=net0,mac=0A:B3:EC:00:00:00 \ @@ -127,7 +127,6 @@ run-cloud-hypervisor: $(imgdir)/appvm/blk/root.img start-vhost-user-gpu start-vi --fs tag=virtiofs0,socket=build/virtiofsd.sock \ --gpu socket=build/vhost-user-gpu.sock \ --kernel $(KERNEL) \ - --cmdline "root=PARTLABEL=root" \ --console tty \ --serial pty .PHONY: run-cloud-hypervisor @@ -136,7 +135,6 @@ run-crosvm: $(imgdir)/appvm/blk/root.img start-vhost-user-gpu start-virtiofsd $(CROSVM_RUN) \ --disk $(imgdir)/appvm/blk/root.img \ --disk $(RUN_IMG) \ - -p "console=ttyS0 root=PARTLABEL=root" \ --vhost-user-fs build/virtiofsd.sock:virtiofs0 \ --vhost-user-gpu build/vhost-user-gpu.sock \ --serial type=file,hardware=serial,path=build/crosvm.log \ diff --git a/img/app/default.nix b/img/app/default.nix index ab87eda..d20d109 100644 --- a/img/app/default.nix +++ b/img/app/default.nix @@ -59,6 +59,8 @@ let kernel = (buildPackages.linux_latest.override { structuredExtraConfig = with lib.kernel; { + CMDLINE_BOOL = yes; + CMDLINE = freeform "console=ttyS0 root=PARTLABEL=root"; VIRTIO = yes; VIRTIO_PCI = yes; VIRTIO_BLK = yes; -- cgit 1.4.1