diff --git a/build_image b/build_image index ad7cf16528..5ac5e1cc72 100755 --- a/build_image +++ b/build_image @@ -18,6 +18,7 @@ assert_inside_chroot assert_not_root_user DEFAULT_GROUP=developer +DEFAULT_DEVCONTAINER_BINHOST="https://mirror.release.flatcar-linux.net" # Developer-visible flags. DEFINE_string board "${DEFAULT_BOARD}" \ @@ -48,6 +49,8 @@ DEFINE_boolean extract_update "${FLAGS_TRUE}" \ "Extract the /usr partition for generating updates." DEFINE_string developer_data "" \ "Insert a custom cloudinit file into the image." +DEFINE_string devcontainer_binhost "${DEFAULT_DEVCONTAINER_BINHOST}" \ + "Override portage binhost configuration used in development container." # include upload options . "${BUILD_LIBRARY_DIR}/release_util.sh" || exit 1 @@ -167,7 +170,7 @@ fix_mtab if [[ "${CONTAINER}" -eq 1 ]]; then IMAGE_BUILD_TYPE="container" - create_dev_container "${FLATCAR_DEVELOPER_CONTAINER_NAME}" "${CONTAINER_LAYOUT}" "${FLAGS_group}" ${FLAGS_base_dev_pkg} + create_dev_container "${FLATCAR_DEVELOPER_CONTAINER_NAME}" "${CONTAINER_LAYOUT}" "${FLAGS_devcontainer_binhost}" "${FLAGS_group}" ${FLAGS_base_dev_pkg} fi if [[ "${PROD_IMAGE}" -eq 1 ]]; then diff --git a/build_library/dev_container_util.sh b/build_library/dev_container_util.sh index 2d9fa71d53..ac43f29a0c 100755 --- a/build_library/dev_container_util.sh +++ b/build_library/dev_container_util.sh @@ -3,12 +3,13 @@ # found in the LICENSE file. get_binhost_url() { - local image_group=$1 - local image_path=$2 + local binhost_base=$1 + local image_group=$2 + local image_path=$3 if [ "${image_group}" == "developer" ]; then - echo "${FLATCAR_DEV_BUILDS}/${image_group}/boards/${BOARD}/${FLATCAR_VERSION}/${image_path}" + echo "${binhost_base}/${image_group}/boards/${BOARD}/${FLATCAR_VERSION}/${image_path}" else - echo "${FLATCAR_DEV_BUILDS}/boards/${BOARD}/${FLATCAR_VERSION_ID}/${image_path}" + echo "${binhost_base}/boards/${BOARD}/${FLATCAR_VERSION_ID}/${image_path}" fi } @@ -35,8 +36,8 @@ PKGDIR="/var/lib/portage/pkgs" PORT_LOGDIR="/var/log/portage" PORTDIR="/var/lib/portage/portage-stable" PORTDIR_OVERLAY="/var/lib/portage/coreos-overlay" -PORTAGE_BINHOST="$(get_binhost_url $2 'pkgs') -$(get_binhost_url $2 'toolchain')" +PORTAGE_BINHOST="$(get_binhost_url "$2" "$3" 'pkgs') +$(get_binhost_url "$2" "$3" 'toolchain')" EOF sudo_clobber "$1/etc/portage/repos.conf/coreos.conf" <