enter_chroot: bind mount depot_tools if present outside chroot.

Another CL is coming to automatically add depot_tools to the PATH
inside the chroot. It's in a different repo.

Review URL: http://codereview.chromium.org/605016
This commit is contained in:
Andrew de los Reyes 2010-02-12 16:12:31 -08:00
parent 6d0ca16277
commit 5d0248feb8

View File

@ -63,6 +63,7 @@ set -e
INNER_CHROME_ROOT="/home/$USER/chrome_root" # inside chroot
CHROME_ROOT_CONFIG="/var/cache/chrome_root" # inside chroot
INNER_DEPOT_TOOLS_ROOT="/home/$USER/depot_tools" # inside chroot
sudo chmod 0777 "$FLAGS_chroot/var/lock"
@ -113,6 +114,17 @@ function setup_env {
sudo mount --bind "$CHROME_ROOT" "$MOUNTED_PATH"
fi
fi
MOUNTED_PATH="$(readlink -f "${FLAGS_chroot}${INNER_DEPOT_TOOLS_ROOT}")"
if [ -z "$(mount | grep -F "on $MOUNTED_PATH")" ]
then
if [ $(which gclient 2>/dev/null) ]; then
echo "Mounting depot_tools"
DEPOT_TOOLS=$(dirname $(which gclient) )
mkdir -p "$MOUNTED_PATH"
sudo mount --bind "$DEPOT_TOOLS" "$MOUNTED_PATH"
fi
fi
) 200>>"$LOCKFILE"
}