sdk_lib: Make git setup more robust.

In particular:
- Move git setup code from make_chroot to enter_chroot. Most of the user
  settings are copied in the enter_chroot script. This increases
- Determine the location of gitcookies from the gitconfig file for the
- Update the gitconfig for the user inside the chroot to point to the
  copied gitcookies file.

TEST=(1) From scratch, run `cros_sdk --create` and manually verify
         gitconfig, gitcookies, when
         (a) gitcookies doesn't exist.
         (b) gitcookies is at ${HOME}/.gitcookies
         (c) gitcookies is elsewhere with gitconfig pointing to it.
     (2) Run a clobber trybot to ensure sane chroot setup.

Change-Id: Ia7fb9a810c8968f7deb2d49367998b39fd3e8084
Reviewed-by: Prathmesh Prabhu <>
Commit-Queue: Prathmesh Prabhu <>
Tested-by: Prathmesh Prabhu <>
2 files changed