diff --git a/sdk_lib/enter_chroot.sh b/sdk_lib/enter_chroot.sh index 3e4d980978..ca2725f13b 100755 --- a/sdk_lib/enter_chroot.sh +++ b/sdk_lib/enter_chroot.sh @@ -586,8 +586,11 @@ CHROOT_PASSTHRU=( "SSH_AUTH_SOCK=${SSH_AUTH_SOCK}" ) +# Some vars we want to keep. +KEEP_VARS="USE GCC_GITHASH" # Pass proxy variables into the environment. -for type in http_proxy ftp_proxy all_proxy GIT_PROXY_COMMAND GIT_SSH; do +PROXY_VARS="http_proxy ftp_proxy all_proxy GIT_PROXY_COMMAND GIT_SSH" +for type in ${KEEP_VARS} ${PROXY_VARS}; do if [ -n "${!type}" ]; then CHROOT_PASSTHRU+=( "${type}=${!type}" ) fi diff --git a/sdk_lib/make_chroot.sh b/sdk_lib/make_chroot.sh index a02ffd1f0d..4d459d211a 100755 --- a/sdk_lib/make_chroot.sh +++ b/sdk_lib/make_chroot.sh @@ -16,6 +16,11 @@ ENTER_CHROOT=$(readlink -f $(dirname "$0")/enter_chroot.sh) enable_strict_sudo +if [ -n "${USE}" ]; then + echo "$SCRIPT_NAME: Building with a non-empty USE: ${USE}" + echo "This modifies the expected behaviour and can fail." +fi + # Check if the host machine architecture is supported. ARCHITECTURE="$(uname -m)" if [[ "$ARCHITECTURE" != "x86_64" ]]; then @@ -457,7 +462,7 @@ fi # As a final pass, build all desired cross-toolchains. info "Updating toolchains" -enter_chroot sudo "${CHROOT_TRUNK}/chromite/bin/cros_setup_toolchains" \ +enter_chroot sudo -E "${CHROOT_TRUNK}/chromite/bin/cros_setup_toolchains" \ "${TOOLCHAIN_ARGS[@]}" command_completed