From ce2e7e8a17a8026d5681d771f34df633ac6aec98 Mon Sep 17 00:00:00 2001 From: David Michael Date: Tue, 28 Aug 2018 13:46:27 +0000 Subject: [PATCH] setup_board: Drop needless SYSROOT when installing binpkgs For the less common case where binpkgs are not used, restructure this so that it builds binpkgs in /usr/${CHOST} without installing them, use those binpkgs to initialize /build/${BOARD}. --- setup_board | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/setup_board b/setup_board index ec6129a8fe..6e16283f8a 100755 --- a/setup_board +++ b/setup_board @@ -305,19 +305,28 @@ if [[ ${FLAGS_regen_configs} -eq ${FLAGS_FALSE} ]]; then EMERGE_FLAGS+=" --usepkg" fi EMERGE_FLAGS+=" --getbinpkg" - EMERGE_TOOLCHAIN_FLAGS+=" --usepkgonly --getbinpkg --rebuilt-binaries n" - else - # When binary packages are disabled we need to make sure the cross - # sysroot includes any build dependencies for the toolchain. - info "Installing toolchain build dependencies" - install_cross_libs "${BOARD_CHOST}" ${EMERGE_FLAGS} --buildpkg=n fi info "Installing baselayout" "${EMERGE_WRAPPER}" ${EMERGE_FLAGS} --nodeps sys-apps/baselayout + if [[ "${FLAGS_usepkg}" -ne "${FLAGS_TRUE}" || + "${FLAGS_getbinpkg}" -ne "${FLAGS_TRUE}" ]] + then + # When binary packages are disabled we need to make sure the cross + # sysroot includes any build dependencies for the toolchain. + info "Installing toolchain build dependencies" + install_cross_libs "${BOARD_CHOST}" ${EMERGE_FLAGS} --buildpkg=n + + info "Building toolchain" + "${EMERGE_WRAPPER}" --buildpkg --buildpkgonly \ + --root="/usr/${BOARD_CHOST}" --sysroot="/usr/${BOARD_CHOST}" \ + ${EMERGE_TOOLCHAIN_FLAGS} "${TOOLCHAIN_PKGS[@]}" + fi + info "Installing toolchain" - SYSROOT="/usr/${BOARD_CHOST}" "${EMERGE_WRAPPER}" \ + "${EMERGE_WRAPPER}" \ + --usepkgonly --getbinpkg --rebuilt-binaries n \ ${EMERGE_TOOLCHAIN_FLAGS} "${TOOLCHAIN_PKGS[@]}" fi