From ef5108f5603f64f71e1996f146a1334807b834b5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 23 Jan 2013 14:35:52 +0100 Subject: [PATCH] Fix registering valid paths in VM tests Commit 37b56574e20755e4c58370bb18a3d373d4ae7cfc revealed that the code to get regInfo from /proc/cmdline was broken. It only happened to work because the kernel passes the command line to stage 1 through the environment, so $regInfo was set anyway. --- modules/virtualisation/qemu-vm.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/virtualisation/qemu-vm.nix b/modules/virtualisation/qemu-vm.nix index eb800e52ab2..cf7738768e1 100644 --- a/modules/virtualisation/qemu-vm.nix +++ b/modules/virtualisation/qemu-vm.nix @@ -306,11 +306,9 @@ in # dependency.) boot.postBootCommands = '' - ( source /proc/cmdline - if [ -n "$regInfo" ]; then - ${config.environment.nix}/bin/nix-store --load-db < $regInfo - fi - ) + if [[ "$(cat /proc/cmdline)" =~ regInfo=([^ ]*) ]]; then + ${config.environment.nix}/bin/nix-store --load-db < ''${BASH_REMATCH[1]} + fi ''; virtualisation.pathsInNixDB =