From 5e1fcca299fddf6a4c851f3f4af3202de57ff8b1 Mon Sep 17 00:00:00 2001 From: liyuanzhen Date: Thu, 30 Jun 2016 03:26:08 +0100 Subject: [PATCH] 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 --- lib/img-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/img-functions b/lib/img-functions index c1fa8af8..adfbb3ef 100644 --- a/lib/img-functions +++ b/lib/img-functions @@ -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 }