From 1da362b34b0dbe3245273a56a3152230484089b0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 30 Oct 2012 17:27:14 +0100 Subject: [PATCH] Fix coverage data collection http://hydra.nixos.org/build/3253046 --- modules/system/boot/systemd.nix | 12 +++++++++++- modules/system/upstart/upstart.nix | 11 +---------- modules/testing/test-instrumentation.nix | 6 +----- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/modules/system/boot/systemd.nix b/modules/system/boot/systemd.nix index aa0b679ea2f..2413509790d 100644 --- a/modules/system/boot/systemd.nix +++ b/modules/system/boot/systemd.nix @@ -229,7 +229,8 @@ let [Service] Environment=PATH=${def.path} - ${concatMapStrings (n: "Environment=${n}=${getAttr n def.environment}\n") (attrNames def.environment)} + ${let env = cfg.globalEnvironment // def.environment; + in concatMapStrings (n: "Environment=${n}=${getAttr n env}\n") (attrNames env)} ${optionalString (!def.restartIfChanged) "X-RestartIfChanged=false"} ${optionalString (def.preStart != "") '' @@ -391,6 +392,15 @@ in description = "Default unit started when the system boots."; }; + boot.systemd.globalEnvironment = mkOption { + type = types.attrs; + default = {}; + example = { TZ = "CET"; }; + description = '' + Environment variables passed to all systemd units. + ''; + }; + services.journald.console = mkOption { default = ""; type = types.uniq types.string; diff --git a/modules/system/upstart/upstart.nix b/modules/system/upstart/upstart.nix index cfde1cc0753..44e6e8bb63b 100644 --- a/modules/system/upstart/upstart.nix +++ b/modules/system/upstart/upstart.nix @@ -19,7 +19,7 @@ let let hasMain = job.script != "" || job.exec != ""; - env = config.system.upstartEnvironment // job.environment; + env = job.environment; preStartScript = makeJobScript "${job.name}-pre-start" '' @@ -270,15 +270,6 @@ in options = [ jobOptions upstartJob ]; }; - system.upstartEnvironment = mkOption { - type = types.attrs; - default = {}; - example = { TZ = "CET"; }; - description = '' - Environment variables passed to all Upstart jobs. - ''; - }; - }; diff --git a/modules/testing/test-instrumentation.nix b/modules/testing/test-instrumentation.nix index c6c95e63af1..8ceffbcb9ec 100644 --- a/modules/testing/test-instrumentation.nix +++ b/modules/testing/test-instrumentation.nix @@ -55,10 +55,6 @@ let kernel = config.boot.kernelPackages.kernel; in # Coverage data is written into /tmp/coverage-data. mkdir -p /tmp/xchg/coverage-data - - # Mount debugfs to gain access to the kernel coverage data (if - # available). - mount -t debugfs none /sys/kernel/debug || true ''; # If the kernel has been built with coverage instrumentation, make @@ -80,7 +76,7 @@ let kernel = config.boot.kernelPackages.kernel; in networking.defaultGateway = mkOverride 150 ""; networking.nameservers = mkOverride 150 [ ]; - system.upstartEnvironment.GCOV_PREFIX = "/tmp/xchg/coverage-data"; + boot.systemd.globalEnvironment.GCOV_PREFIX = "/tmp/xchg/coverage-data"; system.requiredKernelConfig = with config.lib.kernelConfig; [ (isYes "SERIAL_8250_CONSOLE")