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:
parent
314adf9648
commit
37b56574e2
|
@ -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
|
||||
|
|
|
@ -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"}
|
||||
|
|
Loading…
Reference in a new issue