fix(update_chroot): Move to new toolchain_util.sh library

Switch from cros_setup_toolchains to the new simpler toolchain_util code
for installing toolchains in the SDK chroot.
This commit is contained in:
Michael Marineau 2013-11-25 16:45:34 -08:00
parent c5c5696c8b
commit 1186334edf

View File

@ -44,7 +44,8 @@ eval set -- "${FLAGS_ARGV}"
# so will die prematurely if 'switch_to_strict_mode' is specified before now. # so will die prematurely if 'switch_to_strict_mode' is specified before now.
switch_to_strict_mode switch_to_strict_mode
. ${SCRIPTS_DIR}/sdk_lib/make_conf_util.sh . "${BUILD_LIBRARY_DIR}/toolchain_util.sh"
. "${SCRIPTS_DIR}/sdk_lib/make_conf_util.sh"
# Create /etc/make.conf.host_setup. The file content is regenerated # Create /etc/make.conf.host_setup. The file content is regenerated
# from scratch every update. There are various reasons to do this: # from scratch every update. There are various reasons to do this:
@ -93,12 +94,8 @@ if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then
EMERGE_FLAGS="${EMERGE_FLAGS} --getbinpkg" EMERGE_FLAGS="${EMERGE_FLAGS} --getbinpkg"
fi fi
# Only update toolchain when binpkgs are available. Toolchain rollout # Only update toolchain when binpkgs are available.
# process only takes place when the coreos sdk builder finishes EMERGE_FLAGS+=" ${TOOLCHAIN_BINONLY[*]}"
# a successful build.
EMERGE_FLAGS+=" --useoldpkg-atoms=sys-devel/binutils"
EMERGE_FLAGS+=" --useoldpkg-atoms=sys-devel/gcc"
EMERGE_FLAGS+=" --useoldpkg-atoms=sys-libs/glibc"
fi fi
if [[ "${FLAGS_jobs}" -ne -1 ]]; then if [[ "${FLAGS_jobs}" -ne -1 ]]; then
@ -114,19 +111,22 @@ fi
# In first pass, update portage and toolchains. Lagged updates of both # In first pass, update portage and toolchains. Lagged updates of both
# can cause serious issues later. # can cause serious issues later.
if [ "${FLAGS_skip_toolchain_update}" -eq "${FLAGS_FALSE}" ]; then info "Updating basic system packages"
# First update crossdev. sudo -E ${EMERGE_CMD} ${EMERGE_FLAGS} \
sudo -E ${EMERGE_CMD} ${EMERGE_FLAGS} crossdev sysroot-wrappers dev-util/ccache \
sys-apps/portage \
sys-devel/crossdev \
sys-devel/sysroot-wrappers \
"${TOOLCHAIN_PKGS[@]}"
TOOLCHAIN_FLAGS=( "--include-boards=${FLAGS_toolchain_boards}" ) if [[ "${FLAGS_skip_toolchain_update}" -eq "${FLAGS_FALSE}" && \
# This should really only be skipped while bootstrapping. -n "${FLAGS_toolchain_boards}" ]]; then
if [ "${FLAGS_usepkg}" -eq "${FLAGS_FALSE}" ]; then CROSS_CHOSTS=( $(get_board_chost ${FLAGS_toolchain_boards} | sort -u) )
TOOLCHAIN_FLAGS+=( --nousepkg )
elif [ "${FLAGS_getbinpkg}" -eq "${FLAGS_FALSE}" ]; then for cross_chost in "${CROSS_CHOSTS[@]}"; do
TOOLCHAIN_FLAGS+=( --nogetbinpkg ) info "Updating cross ${cross_chost} toolchain"
fi install_cross_toolchain "${cross_chost}" --quiet ${EMERGE_FLAGS}
# Expand the path before sudo, as root doesn't have the same path magic. done
sudo -E $(type -p cros_setup_toolchains) "${TOOLCHAIN_FLAGS[@]}"
fi fi
# Build cros_workon packages when they are changed. # Build cros_workon packages when they are changed.
@ -136,6 +136,7 @@ done
# Second pass, update everything else. # Second pass, update everything else.
EMERGE_FLAGS+=" --deep" EMERGE_FLAGS+=" --deep"
info "Updating all SDK packages"
sudo -E ${EMERGE_CMD} ${EMERGE_FLAGS} \ sudo -E ${EMERGE_CMD} ${EMERGE_FLAGS} \
coreos-devel/sdk-depends world coreos-devel/sdk-depends world