Fix the bug that "mktemp: failed to create directory"

In the function "run_in_target", it is failed that force an empty
TMPDIR inside the chroot. The TMPDIR is still the user defined
tmp dir. Due to the TMPDIR dir is not exist, using "mktemp" to
create tmp dir is failed.

Change-Id: I898f80099bc2a7c32e8676014d0f4263807f7039
Closes-Bug: #1597569
This commit is contained in:
liyuanzhen 2016-06-30 03:26:08 +01:00
parent dfec75d283
commit 5e1fcca299

View File

@ -63,7 +63,7 @@ function run_in_target () {
# Bug: #1330290
# Force the inclusion of a typical set of dirs in PATH, this is needed for guest
# distros that have path elements not in the host PATH.
sudo -E TMPDIR= chroot $TMP_MOUNT_PATH env PATH="\$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" sh -c "$cmd"
sudo -E chroot $TMP_MOUNT_PATH env -u TMPDIR PATH="\$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" sh -c "$cmd"
export HOME=$ORIG_HOME
}