Fix coverage data collection

http://hydra.nixos.org/build/3253046
This commit is contained in:
Eelco Dolstra 2012-10-30 17:27:14 +01:00
parent e5d4524dda
commit 1da362b34b
3 changed files with 13 additions and 16 deletions

View File

@ -229,7 +229,8 @@ let
[Service] [Service]
Environment=PATH=${def.path} 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.restartIfChanged) "X-RestartIfChanged=false"}
${optionalString (def.preStart != "") '' ${optionalString (def.preStart != "") ''
@ -391,6 +392,15 @@ in
description = "Default unit started when the system boots."; description = "Default unit started when the system boots.";
}; };
boot.systemd.globalEnvironment = mkOption {
type = types.attrs;
default = {};
example = { TZ = "CET"; };
description = ''
Environment variables passed to <emphasis>all</emphasis> systemd units.
'';
};
services.journald.console = mkOption { services.journald.console = mkOption {
default = ""; default = "";
type = types.uniq types.string; type = types.uniq types.string;

View File

@ -19,7 +19,7 @@ let
let let
hasMain = job.script != "" || job.exec != ""; hasMain = job.script != "" || job.exec != "";
env = config.system.upstartEnvironment // job.environment; env = job.environment;
preStartScript = makeJobScript "${job.name}-pre-start" preStartScript = makeJobScript "${job.name}-pre-start"
'' ''
@ -270,15 +270,6 @@ in
options = [ jobOptions upstartJob ]; options = [ jobOptions upstartJob ];
}; };
system.upstartEnvironment = mkOption {
type = types.attrs;
default = {};
example = { TZ = "CET"; };
description = ''
Environment variables passed to <emphasis>all</emphasis> Upstart jobs.
'';
};
}; };

View File

@ -55,10 +55,6 @@ let kernel = config.boot.kernelPackages.kernel; in
# Coverage data is written into /tmp/coverage-data. # Coverage data is written into /tmp/coverage-data.
mkdir -p /tmp/xchg/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 # 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.defaultGateway = mkOverride 150 "";
networking.nameservers = 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; [ system.requiredKernelConfig = with config.lib.kernelConfig; [
(isYes "SERIAL_8250_CONSOLE") (isYes "SERIAL_8250_CONSOLE")