From 72d65de44bcdc0a75a9f1a3b4e8fc564709db913 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Wed, 16 Oct 2019 10:15:55 +0200 Subject: [PATCH] support --binhost= option for setup_board and update_chroot Add an option to specify `--binhost=`, to make the scripts download binary packages from any arbitrary host. This is needed to get around toolchain issues when building rust. --- setup_board | 7 ++++++- update_chroot | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/setup_board b/setup_board index cfdafa6503..24e3fa11cf 100755 --- a/setup_board +++ b/setup_board @@ -27,6 +27,8 @@ DEFINE_boolean getbinpkg "${FLAGS_TRUE}" \ "Download binary packages from remote repository." DEFINE_string getbinpkgver "" \ "Use binary packages from a specific version." +DEFINE_string binhost "" \ + "Use binary packages from a specific location (e.g. https://storage.googleapis.com/flatcar-jenkins/sdk/amd64/2000.0.0/pkgs)" DEFINE_boolean toolchainpkgonly "${FLAGS_FALSE}" \ "Use binary packages only for the board toolchain." DEFINE_integer jobs "${NUM_JOBS}" \ @@ -159,7 +161,7 @@ BOARD_ETC="${BOARD_ROOT}/etc" BOARD_ARCH=$(get_board_arch "$BOARD") BOARD_CHOST=$(get_board_chost ${BOARD}) PORTAGE_PROFILE=$(get_board_profile "$BOARD") -BOARD_BINHOST=$(generate_binhost_list) +BOARD_BINHOST="$FLAGS_binhost $(generate_binhost_list)" if [[ ${FLAGS_regen_configs_only} -eq ${FLAGS_TRUE} ]]; then FLAGS_regen_configs=${FLAGS_TRUE} @@ -198,6 +200,9 @@ if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then else UPDATE_ARGS+=" --nogetbinpkg " fi + if [[ -n "${FLAGS_binhost}" ]]; then + UPDATE_ARGS+=" --binhost=${FLAGS_binhost} " + fi else UPDATE_ARGS+=" --nousepkg" fi diff --git a/update_chroot b/update_chroot index 254b89dc5f..3e93c7e8fd 100755 --- a/update_chroot +++ b/update_chroot @@ -27,6 +27,8 @@ DEFINE_boolean skip_toolchain_update "${FLAGS_FALSE}" \ "Don't update the toolchains." DEFINE_string toolchain_boards "" \ "Extra toolchains to setup for the specified boards." +DEFINE_string binhost "" \ + "Use binary packages from a specific location (e.g. https://storage.googleapis.com/flatcar-jenkins/sdk/amd64/2000.0.0/pkgs)" FLAGS_HELP="usage: $(basename $0) [flags] Performs an update of the chroot. This script is called as part of @@ -57,6 +59,7 @@ PORTAGE_STABLE_OVERLAY="${REPO_ROOT}/src/third_party/portage-stable" CROSSDEV_OVERLAY="/usr/local/portage/crossdev" COREOS_OVERLAY="${REPO_ROOT}/src/third_party/coreos-overlay" COREOS_CONFIG="${COREOS_OVERLAY}/coreos/config" +PORTAGE_BINHOST="$FLAGS_binhost $(get_sdk_binhost)" # PORTAGE_USERNAME may already be in the env but set just to be safe. : ${PORTAGE_USERNAME:=${USER}} @@ -83,7 +86,7 @@ PORTDIR_OVERLAY="${CROSSDEV_OVERLAY} ${COREOS_OVERLAY}" DISTDIR="${REPO_CACHE_DIR}/distfiles" PKGDIR="/var/lib/portage/pkgs" PORT_LOGDIR="/var/log/portage" -PORTAGE_BINHOST="$(get_sdk_binhost)" +PORTAGE_BINHOST="$PORTAGE_BINHOST" PORTAGE_USERNAME="${PORTAGE_USERNAME}" MAKEOPTS="--jobs=${NUM_JOBS} --load-average=$((NUM_JOBS * 2))" CCACHE_UMASK="002"