enter_chroot: copy over ssh configuration

TEST=clean (first) enter_chroot.sh; repo sync

The developer instructions for setting up chroot include steps to set up
~/.ssh/config to correctly set up ports and options. And while several
attempts are made in enter_chroot to forward ssh-agent and ssh
authentication to chroot as well, the ssh config stays outside of
chroot, which prevents all attempts to contact the git servers if rw URL
is used.

This makes a copy of config on entering the chroot, allowing people to
use repo from within the chroot. That is not bulletproof and does not
reflect changes of config while inside the chroot, but that should be a
borderline case.

Change-Id: I1fcbf00c413c7af8ef14fc1e846192ac95de106d

BUG=n0ne

Review URL: http://codereview.chromium.org/6065011
This commit is contained in:
Zdenek Behan 2011-01-05 00:56:32 +01:00
parent 3f898563fb
commit 75805716f5

View File

@ -142,6 +142,7 @@ function setup_env {
then
mkdir -p "${TARGET_DIR}"
cp -r "${HOME}/.ssh/known_hosts" "${TARGET_DIR}"
cp -r "${HOME}/.ssh/config" "${TARGET_DIR}"
ASOCK="$(dirname "${SSH_AUTH_SOCK}")"
mkdir -p "${FLAGS_chroot}/${ASOCK}"
sudo mount --bind "${ASOCK}" "${FLAGS_chroot}/${ASOCK}" || \