diff --git a/sdk_lib/enter_chroot.sh b/sdk_lib/enter_chroot.sh index 58cb0f5307..8e764444a0 100755 --- a/sdk_lib/enter_chroot.sh +++ b/sdk_lib/enter_chroot.sh @@ -470,11 +470,15 @@ setup_env() { fi # If the private overlays are installed, gsutil can use those credentials. - if [ ! -e "${FLAGS_chroot}/home/${USER}/.boto" ]; then - boto='src/private-overlays/chromeos-overlay/googlestorage_account.boto' - if [ -s "${FLAGS_trunk}/${boto}" ]; then + # We're also installing credentials for use by sudoed invocations. + boto='src/private-overlays/chromeos-overlay/googlestorage_account.boto' + if [ -s "${FLAGS_trunk}/${boto}" ]; then + if [ ! -e "${FLAGS_chroot}/home/${USER}/.boto" ]; then ln -s "trunk/${boto}" "${FLAGS_chroot}/home/${USER}/.boto" fi + if [ ! -e "${FLAGS_chroot}/root/.boto" ]; then + sudo ln -s "../home/${USER}/trunk/${boto}" "${FLAGS_chroot}/root/.boto" + fi fi # Have found a few chroots where ~/.gsutil is owned by root:root, probably