vm/windows: Save envirenoment before running VM.
Later, when we start the actual builder, we're going to restore those environment variables. We're using "(set; declare -p)", here, because the former is just printing _all_ environment variables, even those not supported, and the latter only lists specifically declared variables, which also encludes exports. The "declare -p" command also emits those variables in a format similar to the "export" command. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
parent
707b7ad1bd
commit
dd8b0fcf52
@ -172,7 +172,9 @@ let
|
|||||||
});
|
});
|
||||||
|
|
||||||
preVM = ''
|
preVM = ''
|
||||||
|
(set; declare -p) > saved-env
|
||||||
XCHG_DIR="$(${coreutils}/bin/mktemp -d nix-vm.XXXXXXXXXX --tmpdir)"
|
XCHG_DIR="$(${coreutils}/bin/mktemp -d nix-vm.XXXXXXXXXX --tmpdir)"
|
||||||
|
${coreutils}/bin/mv saved-env "$XCHG_DIR/"
|
||||||
QEMU_VDE_SOCKET="$(pwd)/vde.ctl"
|
QEMU_VDE_SOCKET="$(pwd)/vde.ctl"
|
||||||
MONITOR_SOCKET="$(pwd)/monitor"
|
MONITOR_SOCKET="$(pwd)/monitor"
|
||||||
${vde2}/bin/vde_switch -s "$QEMU_VDE_SOCKET" &
|
${vde2}/bin/vde_switch -s "$QEMU_VDE_SOCKET" &
|
||||||
|
Loading…
x
Reference in New Issue
Block a user