about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-06-14 21:54:39 +0000
committerAlyssa Ross <hi@alyssa.is>2023-11-06 13:49:31 +0100
commit8ab2f09522d5aefabf1100b3f59a3bde628cb2b4 (patch)
tree92ea009eec2ea34a84763708ff60808005f4d93c /pkgs
parenta29cae7046d725a77dc2611dfaf2c69fe103f609 (diff)
nixos/qemu-vm: fix infinite recursion
The virtualisation.directBoot.initrd option was added for netboot
images, but the assertion to check directBoot enabled if it was used
caused an infinite recursion if it was.  Minimal reproduction:

	import nixos/tests/make-test-python.nix ({ pkgs, ... }: {
	  name = "";

	  nodes = {
	    machine = { config, ...}: {
	      imports = [ nixos/modules/installer/netboot/netboot-minimal.nix ];

	      virtualisation.directBoot = {
	        enable = true;
	        initrd = "${config.system.build.netbootRamdisk}/${config.system.boot.loader.initrdFile}";
	      };
	    };
	  };
	  testScript = "";
	}) {}

The fix is to swap the two conditions, so that cfg.directBoot.enable
is checked first, and the initrd comparision will be short circuited.

This wasn't noticed during review because in earlier versions of the
virtualisation.directBoot patch, the assertion was accidentally in the
conditional above, so wasn't evaluated unless port forwarding was in
use.
Diffstat (limited to 'pkgs')
0 files changed, 0 insertions, 0 deletions