bootstrap_sdk, build_toolchains: Move the ROOT_OVERLAY variable

ROOT_OVERLAY variable is defined in terms of TEMPDIR. The TEMPDIR
variable is set to an empty value by catalyst.sh, which the two
scripts import. So ROOT_OVERLAY always ended up being located in
toplevel directory (i.e. `/`). But the TEMPDIR variable gets a
meaningful value after calling the catalyst_init function, so define
the ROOT_OVERLAY after the function is called.
This commit is contained in:
Krzesimir Nowak 2021-01-20 23:00:45 +01:00
parent 215583ff4d
commit aab2cb5c77
2 changed files with 3 additions and 4 deletions

View File

@ -40,8 +40,6 @@ TYPE="flatcar-sdk"
# include upload options
. "${BUILD_LIBRARY_DIR}/release_util.sh" || exit 1
ROOT_OVERLAY=${TEMPDIR}/stage4_overlay
## Define the stage4 config template
catalyst_stage4() {
cat <<EOF
@ -63,6 +61,7 @@ export GENTOO_MIRRORS
catalyst_init "$@"
check_gsutil_opts
ROOT_OVERLAY=${TEMPDIR}/stage4_overlay
if [[ "$STAGES" =~ stage4 ]]; then
info "Setting release to ${FLATCAR_VERSION}"

View File

@ -15,8 +15,6 @@ FORCE_STAGES="stage4"
# 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
@ -32,6 +30,8 @@ catalyst_stage_default
catalyst_init "$@"
check_gsutil_opts
ROOT_OVERLAY="${TEMPDIR}/stage4-${ARCH}-$FLAGS_version-overlay"
# toolchain_util.sh is required by catalyst_toolchains.sh
mkdir -p "${ROOT_OVERLAY}/tmp"
cp "${BUILD_LIBRARY_DIR}/toolchain_util.sh" "${ROOT_OVERLAY}/tmp"