Merge "Append full path to img-functions:run_in_target"

This commit is contained in:
Jenkins 2015-04-22 19:06:12 +00:00 committed by Gerrit Code Review
commit f0736e7d97
1 changed files with 3 additions and 3 deletions

View File

@ -56,11 +56,11 @@ function ensure_sudo () {
# Helper function to run a command inside the chroot
function run_in_target () {
# Force the inclusion of /usr/local/bin in PATH, this is needed for some
# distros that does not include /usr/local/bin in the sudoers secure_path.
# 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.
# Note that we're not expanding PATH during argument processing, the \$
# will preserve the PATH syntax until after the sh command runs
cmd="PATH=\$PATH:/usr/local/bin ; $@"
cmd="PATH=\$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ; $@"
# -E to preserve http_proxy
ORIG_HOME=$HOME
export HOME=/root