flatcar-scripts/build_toolchains
Kai Lüke 74f04c59f7
Reuse correct binary packages for a Flatcar version
Two Flatcar versions were used in /etc/portage/make.conf both in the SDK
and in the boards.
Use only a single version by default to get the expected results and not
something else when using binary packages.

The Rust crossdev package was never uploaded to /sdk/ and always
had to be compiled again.
Upload it in a separate toolchain-arm64 directory because /Packages in /crossdev/
doesn't refer to the Rust package and its use flags.
2020-05-11 15:45:21 +02:00

61 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
#
# Copyright (c) 2013 The CoreOS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
SCRIPT_ROOT=$(dirname $(readlink -f "$0"))
. "${SCRIPT_ROOT}/common.sh" || exit 1
TYPE="coreos-toolchains"
FORCE_STAGES="stage4"
. "${BUILD_LIBRARY_DIR}/catalyst.sh" || exit 1
# include upload options
. "${BUILD_LIBRARY_DIR}/release_util.sh" || exit 1
ROOT_OVERLAY="${TEMPDIR}/stage4-${ARCH}-$FLAGS_version-overlay"
## Define the stage4 config template
catalyst_stage4() {
cat <<EOF
target: stage4
pkgcache_path: $BINPKGS
stage4/packages: @system
stage4/fsscript: ${BUILD_LIBRARY_DIR}/catalyst_toolchains.sh
stage4/root_overlay: ${ROOT_OVERLAY}
EOF
catalyst_stage_default
}
catalyst_init "$@"
check_gsutil_opts
# toolchain_util.sh is required by catalyst_toolchains.sh
mkdir -p "${ROOT_OVERLAY}/tmp"
cp "${BUILD_LIBRARY_DIR}/toolchain_util.sh" "${ROOT_OVERLAY}/tmp"
catalyst_build
def_upload_path="${UPLOAD_ROOT}/sdk/${ARCH}/${FLAGS_version}"
sign_and_upload_files "cross toolchain packages" "${def_upload_path}" \
"toolchain/" "${BINPKGS}/crossdev"/*
for board in $(get_board_list); do
if [ "$board" = arm64-usr ]; then
sign_and_upload_files "Rust aarch64 crossdev toolchain packages" "${def_upload_path}" \
"toolchain-arm64/" "${BINPKGS}/target/${board}"/Packages "${BINPKGS}/target/${board}"/dev-lang/rust*
fi
done
# TODO: Actually just TOOLCHAIN_PKGS and the exact dependencies should be uploaded
for board in $(get_board_list); do
board_packages="${BINPKGS}/target/${board}"
def_upload_path="${UPLOAD_ROOT}/boards/${board}/${FLAGS_version}"
sign_and_upload_files "board toolchain packages" "${def_upload_path}" \
"toolchain/" "${board_packages}"/*
done
command_completed