summary refs log tree commit diff
path: root/vm
Commit message (Collapse)AuthorAge
* vm/app/gnome-text-editor: initAlyssa Ross2024-05-29
| | | | | | | | | | This will be useful for testing portals. GDK_DEBUG is set to force the use of portals. In future, we might be able to use the /.flatpak-info interface instead of using the debug environment variable. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* Switch from writeReferencesToFile to writeClosureAlyssa Ross2024-04-04
| | | | | | writeReferencesToFile is deprecated. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* Access PACKAGES through the shell instead of makeAlyssa Ross2024-04-03
| | | | | | | | | | | | | | | | The command line here was still getting too long for the shell. Previously, I assumed this was make-erofs.sh's command line, but it was probably actually the command line for the shell invoked by make with sh -c. To reduce the length of this, don't have make pass the whole PACKAGES list to the shell. Instead have the shell read it from the environment itself. PACKAGES is not defined in the Makefile, so it has to be provided either in the environment or on the make command line. POSIX specifies that macros defined on the make command line are added to the environment, so this should still work in both cases. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* scripts/make-erofs.sh: take paths on stdinAlyssa Ross2024-03-28
| | | | | | The command line for the rootfs EROFS is nearing argv limits. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: remove explicit CONFIG_EXPERTAlyssa Ross2024-03-25
| | | | | | | This is set in Nixpkgs since 3b07356d2d55 ("linux/kernel/common-config: support DFS radiations for ath(9|10)k drivers"). Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: unset CONFIG_RC_CORE for kernelAlyssa Ross2024-03-25
| | | | | | | This will be required to keep the kernel config building once our Nixpkgs includes cb39b353041d ("linux/common-config: enable RC_CORE explicitly"). Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: disable CONFIG_DRM_FBDEV_EMULATIONAlyssa Ross2024-01-19
| | | | | | | This fixes an empty crosvm GPU display being displayed when a wayland client in the VM disconnects, for example if a foot window is closed. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: sort kernel config alphabeticallyAlyssa Ross2024-01-19
| | | | | | | | I don't think there's a better way to organise this, because some settings might be required for multiple different reasons, e.g. CONFIG_EXPERT. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm/sys/net: remove unused D-Bus stuffAlyssa Ross2023-12-20
| | | | Signed-off-by: Alyssa Ross <hi@alyssa.is>
* Filter Spectrum sources for each componentAlyssa Ross2023-12-17
| | | | | | | At long last, changing one file somewhere won't cause every Spectrum component to be rebuilt unnecessarily. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* pkgs: use filesets for srcAlyssa Ross2023-12-17
| | | | | | | | This will make it possible later to specify which directories actually need to be present to build a component, so changing a single file somewhere won't force rebuilds of every Spectrum component. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: add missing iproute2 shell inputAlyssa Ross2023-12-17
| | | | | Fixes: 2757209 ("vm/sys/net: create TAPs for testing in namespace") Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm/sys/net: fix cloud-hypervisor argumentsAlyssa Ross2023-12-17
| | | | | Fixes: 715033d ("lib/nixpkgs.default.nix: update") Signed-off-by: Alyssa Ross <hi@alyssa.is>
* Increase VM memory sizeAlyssa Ross2023-12-05
| | | | | | | | 128M was not enough to even get to init on aarch64. We can probably optimise the kernel at some point, but I think that's something to do once things are further along. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm/app/poweroff.nix: initAlyssa Ross2023-12-05
| | | | | | | | | | A VM that just powers itself off once it's successfully booted is very useful for testing, especially automated testing. I don't think there's any reason to actually install this on the rootfs / user data partition at the moment. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: send cloud-hypervisor serial output to fileAlyssa Ross2023-12-05
| | | | | | | | | | | | This didn't originally go to a file, because I still had to use the serial console interactively for debugging sometimes. Now that things have settled a bit and the serial console is write-only, having serial go to a pty is just needlessly inconvenient. I've updated the crosvm target to put its logs in the same place, so the path to serial logs only has to be learned once. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm/sys/net: create TAPs for testing in namespaceAlyssa Ross2023-12-05
| | | | | | | This removes the need to do anything as root to make run with VMM=cloud-hypervisor or VMM=crosvm. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* Revert "vm: build command line into kernels"Alyssa Ross2023-12-05
| | | | | | | | | | | | | | | | | | This reverts commit 5f556f806a70f3787fe725254ccf3d245bd5bebc. This turns out to not really be workable on aarch64 at the moment, without giving things up — both crosvm and Cloud Hypervisor inject earlycon parameters onto the command line, which overrides the built-in command line. We could use CONFIG_CMDLINE_FORCE, but then we wouldn't know which serial console to use, because crosvm and Cloud Hypervisor both use different ones. There's discussion about making it possible to have the bootloader command line append to the built-in command line, but it's moving extremely slowly, so we can't count on it any time soon. Link: https://lore.kernel.org/lkml/20231110013817.2378507-1-danielwa@cisco.com/ Signed-off-by: Alyssa Ross <hi@alyssa.is>
* lib: adjust interface for Nix filesAlyssa Ross2023-11-26
| | | | | | | | | | | | | | | | | | | | | | | This moves every directly-buildable Nix file in Spectrum from the old eval-config.nix interface to a new callPackage-based interface. This moves us in the direction of stopping files from directly importing each other, in favor of having a global package set that contains the Spectrum-specific packages. Aside from consistency with packages from Nixpkgs, the main advantage to this is that the packages will be correctly spliced, and so e.g. lseek being in nativeBuildInputs will now do the right thing. This is implemented using a scope, so the Spectrum packages are invisible to Nixpkgs, and are applied on top afterwards, in contrast to if an overlay was used. Having a customised package set also paves the way for bringing modifications to upstream packages (e.g. the Cloud Hypervisor virtio-gpu patches) into the Spectrum repository, allowing us to use an unmodified upstream Nixpkgs. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: use linux from pkgsStaticAlyssa Ross2023-11-22
| | | | | | | | | I think the original reason for not using the pkgsStatic version of the kernel was just that it was built by cache.nixos.org. Now that we're using a custom configuration, it wouldn't be cached anyway, so let's not special case the kernel any more. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: don't use buildPackages for kernelAlyssa Ross2023-11-21
| | | | | | | This was used just to get out of pkgsStatic, but when cross compiling, it won't give us a kernel for the architecture we want. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: unset FRAMEBUFFER_CONSOLE_DETECT_PRIMARYAlyssa Ross2023-11-21
| | | | | | | | Newer versions of Nixpkgs have started setting this. Since we don't have a framebuffer console in our kernels, when we're on that newer Nixpkgs, this will need to be unset. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: build command line into kernelsAlyssa Ross2023-11-21
| | | | | | | | | | 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 <hi@alyssa.is>
* vm/app/mg.nix: fix direct evaluationAlyssa Ross2023-10-13
| | | | | | | | | | This wasn't updated when eval-config.nix was changed and moved into lib. Importing the file and passing config in worked, but evaluating it directly didn't, because it tried to import a path that no longer exists. Fixes: c3fbeca ("lib/common.mk: init") Signed-off-by: Alyssa Ross <hi@alyssa.is>
* Add make targets for kernel debuggingAlyssa Ross2023-10-11
| | | | | | | | At the moment, only QEMU creates the GDB socket, so this only works with QEMU. cloud-hypervisor isn't built with GDB support, and it doesn't work very well anyway. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* Use lib.getExe where possibleAlyssa Ross2023-09-27
| | | | Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm/app/hello-wayland.nix: removeAlyssa Ross2023-09-25
| | | | | | | | | | This was useful while it was the only Wayland client we could run, but since it doesn't start reliably[1], and we can now run complex clients, appvm-hello-wayland isn't really providing value any more. [1]: https://github.com/emersion/hello-wayland/pull/19 Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm/app/foot.nix: don't create /run/opengl-driverAlyssa Ross2023-09-25
| | | | | | | | There are no Mesa drivers in VMs since the previous commit. I didn't notice this line was still here, now not doing anything useful. Fixes: 16db4a0 ("vm: remove mesa drivers") Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: remove mesa driversAlyssa Ross2023-09-25
| | | | | | | | | | | | | This includes a revert of commit 1a754374028ced6eea2dd77a2f829b511d2e90ba. vm-lib/make-vm.nix was not the right place for the Mesa drivers to be added — it meant that every VM had its own copy of the drivers, whether it used them or not. And right now, nothing uses the Mesa drivers. This will only be the case if we do GPU passthrough at some point. When that happens, we can add them in a more sensible way, in img/app. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm/app/foot.nix: initAlyssa Ross2023-09-19
| | | | | | | | | | | This demonstrates that, as a result of upstream developments, we are now able to run clients without them freezing after a couple of seconds [1], and without crashing if they use the keymap [2]. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=70d1ace56db6c79d39dbe9c0d5244452b67e2fde [2]: https://chromium.googlesource.com/chromiumos/platform/crosvm/+/998597a1bd29432bdee28d298511549edff1434a Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm/app: add hello-wayland demo VMAlyssa Ross2023-07-28
| | | | | | | | | hello-wayland is the simplest possible Wayland client. This VM is used to demonstrate Spectrum's new Wayland capabilities. Signed-off-by: Alyssa Ross <alyssa.ross@unikie.com> Signed-off-by: Alyssa Ross <hi@alyssa.is> Message-Id: <20230721180015.597099-7-hi@alyssa.is>
* vm: add support for testing in crosvmAlyssa Ross2023-07-28
| | | | | | | | | | This is useful because it allows comparing how our patched cloud-hypervisor behaves against crosvm's implementation. Signed-off-by: Alyssa Ross <alyssa.ross@unikie.com> Co-authored-by: Alyssa Ross <hi@alyssa.is> Signed-off-by: Alyssa Ross <hi@alyssa.is> Message-Id: <20230721180015.597099-5-hi@alyssa.is>
* Enable kernel debugging in QEMU make run targetsAlyssa Ross2023-06-07
| | | | Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: switch to EROFSAlyssa Ross2023-05-31
|
* vm/app/mg.nix: remove suprious netvm dependencyAlyssa Ross2023-05-27
| | | | Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: support "make run" on aarch64Alyssa Ross2023-05-09
| | | | Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: disable VT in kernelsAlyssa Ross2023-05-09
| | | | | | | | We have no use for VTs in guests, and disabling them means that we don't need a console parameter on the kernel command line on aarch64. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: use the default kernel target on non-x86Alyssa Ross2023-04-29
| | | | | | | | | cloud-hypervisor only supports x86_64 and aarch64, but it's clear that it's x86_64 that's the odd one out when it comes to needing special kernel images. So let's assume we should use the default kernel target, except on x86 where we know we shouldn't. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: use a stripped vmlinuxAlyssa Ross2023-04-27
| | | | | | | | This reduces the combined image from 9.1G to 7.2G, and also gets us away from using the vmlinux from dev, which we wouldn't be able to do on aarch64 anyway. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* Run deadnixAlyssa Ross2023-04-27
| | | | Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: don't build DRM into kernelsAlyssa Ross2023-04-24
| | | | | | | | Possibly we want to disable this entirely, but let's wait until we have Wayland working, and a better approach to kernel configuration, before we worry about that. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* Remove redundant VMLINUX make variablesAlyssa Ross2023-04-13
| | | | | | | | Both places this was used, there was a KERNEL variable with the same value. On other architectures, we might not even use vmlinux, so keeping KERNEL makes more sense. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* lib/nixpkgs.default.nix: updateAlyssa Ross2023-04-09
| | | | | | | cloud-hypervisor has changed the CLI, so we have to update every place we invoke it. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* scripts/make-gpt.sh: use copy_file_range(2)Alyssa Ross2023-03-21
| | | | | | | | Before this change, a clean release/live "make -j4" had a median runtime of 85 seconds. Now, it's 37 seconds. That much of a reduction in iteration time is worth the extra complexity. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* Use consistent indentation in MakefilesAlyssa Ross2023-03-16
| | | | Signed-off-by: Alyssa Ross <hi@alyssa.is>
* Put sockets created by Makefiles into build dirsAlyssa Ross2023-03-16
| | | | | | | This way, we don't have to worry about them confusing Nix, or the lockfiles ending up in git. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm: remove vmm.sock before cloud-hypervisor startsAlyssa Ross2023-03-13
| | | | | | | Otherwise, cloud-hypervisor won't be able to bind to the path and will fail to start. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* Build make targets directly into destinationsAlyssa Ross2023-03-12
| | | | | | | | | | | | | | | Our image Makefiles are either used for interactive development in a nix-shell, or as part of a Nix build of Spectrum. In neither of these cases is the two step "make; make install" process useful like it is for packages, because one image from Spectrum somewhere on the development system isn't something it ever makes sense to do. By removing the separation between building and installing, and creating the final output directly in its destination, we can save some copies of very large files, which should save seconds in each build, even for the smaller components. Signed-off-by: Alyssa Ross <hi@alyssa.is>
* Remove unused hasSuffix inheritsAlyssa Ross2023-03-12
| | | | | | | | | This was widely used when each component was responsible for filtering out its own Nix files, but now that's centralised, all these bindings can be cleaned up. Fixes: 0149885 ("nix: centralise source cleaning") Signed-off-by: Alyssa Ross <hi@alyssa.is>
* vm/app/mg.nix: open virtio filesystem in diredAlyssa Ross2023-02-26
| | | | | Signed-off-by: Alyssa Ross <hi@alyssa.is> Message-Id: <20221010232909.1953738-11-hi@alyssa.is>