3
0
Fork 0
forked from mirrors/nixpkgs

stage-1: Clear environment before calling stage-2

In particular, stage-1's LD_LIBRARY_PATH should not infect stage-2.
Reported by viric.
This commit is contained in:
Eelco Dolstra 2013-01-23 11:51:58 +01:00
parent 314adf9648
commit 37b56574e2
2 changed files with 2 additions and 1 deletions

View file

@ -365,6 +365,6 @@ mount --move /sys $targetRoot/sys
mount --move /dev $targetRoot/dev
mount --move /run $targetRoot/run
exec switch_root "$targetRoot" "$stage2Init"
exec env -i $(type -P switch_root) "$targetRoot" "$stage2Init"
fail # should never be reached

View file

@ -224,6 +224,7 @@ let
[Service]
Environment=PATH=${def.path}
Environment=LD_LIBRARY_PATH=
${let env = cfg.globalEnvironment // def.environment;
in concatMapStrings (n: "Environment=${n}=${getAttr n env}\n") (attrNames env)}
${optionalString (!def.restartIfChanged) "X-RestartIfChanged=false"}