fix(catalyst): Always use the current SDK tarball as seed.

Right now there is some funky logic to either use a previous build as a
seed or the current SDK tarball if it happens to have been downloaded.
This is a bit confusing and doesn't work reliably since it is reasonable
for there to be neither a previous build or the current SDK available if
the SDK chroot was created some time ago. Fix this by using the new SDK
library and always use the latest SDK, downloading it if needed.
This commit is contained in:
Michael Marineau 2013-11-23 20:32:55 -08:00
parent 59ef0901d3
commit 75972cd991
5 changed files with 8 additions and 45 deletions

View File

@ -34,8 +34,6 @@ SCRIPT_ROOT=$(dirname $(readlink -f "$0"))
. "${SCRIPT_ROOT}/common.sh" || exit 1
TYPE="coreos-sdk"
ARCH=$(portageq envvar ARCH)
DEFAULT_PROFILE="coreos:default/linux/${ARCH}/10.0"
. "${BUILD_LIBRARY_DIR}/catalyst.sh" || exit 1

View File

@ -8,9 +8,6 @@ SCRIPT_ROOT=$(dirname $(readlink -f "$0"))
. "${SCRIPT_ROOT}/common.sh" || exit 1
TYPE="coreos-buildbot"
ARCH=$(portageq envvar ARCH)
DEFAULT_SEED="builds/coreos-sdk/stage4-${ARCH}-latest.tar.bz2"
DEFAULT_PROFILE="coreos:default/linux/${ARCH}/10.0"
FORCE_STAGES="stage4"
. "${BUILD_LIBRARY_DIR}/catalyst.sh" || exit 1

View File

@ -131,6 +131,8 @@ generate_au_zip () {
local largs="-o ${BUILD_DIR}"
test ! -d "${BUILD_DIR}" && mkdir -p "${BUILD_DIR}"
info "Running ${lgenerateauzip} ${largs} for generating AU updater zip file"
# Make sure some vars this script needs are exported
export REPO_MANIFESTS_DIR SCRIPTS_DIR
$lgenerateauzip $largs
}

View File

@ -5,20 +5,17 @@
# common.sh should be sourced first
[[ -n "${DEFAULT_BUILD_ROOT}" ]] || exit 1
. "${SCRIPTS_DIR}/sdk_lib/sdk_util.sh"
# Default option values, may be provided before including this file
: ${TYPE:="coreos-sdk"}
: ${ARCH:=$(portageq envvar ARCH)}
: ${DEFAULT_CATALYST_ROOT:="${DEFAULT_BUILD_ROOT}/catalyst"}
: ${DEFAULT_SEED:="builds/${TYPE}/stage4-${ARCH}-latest.tar.bz2"}
: ${DEFAULT_SEED:=${COREOS_SDK_TARBALL_PATH}}
: ${DEFAULT_PROFILE:="coreos:default/linux/${ARCH}/10.0"}
# Set to something like "stage4" to restrict what to build
# FORCE_STAGES=
if [[ "${DEFAULT_SEED}" != /* ]]; then
DEFAULT_SEED="${DEFAULT_CATALYST_ROOT}/${DEFAULT_SEED}"
fi
# Values set in catalyst_init, don't use till after calling it
CATALYST_ROOT=
DEBUG=
@ -28,11 +25,6 @@ DISTDIR=
TEMPDIR=
STAGES=
# For searching for alternatives when DEFAULT_SEED doesn't exist
# unset SDK_SEARCH=1 to disable this fallback
SDK_TARBALL="coreos-sdk-${ARCH}-${COREOS_SDK_VERSION}.tar.bz2"
SDK_SEARCH=1
DEFINE_string catalyst_root "${DEFAULT_CATALYST_ROOT}" \
"Path to directory for all catalyst images and other files."
DEFINE_string portage_stable "${SRC_ROOT}/third_party/portage-stable" \
@ -182,8 +174,10 @@ catalyst_init() {
TEMPDIR="$CATALYST_ROOT/tmp/$TYPE"
DISTDIR="$CATALYST_ROOT/distfiles"
# possibly search for existing seeds
search_for_sdk_seed
# automatically download the current SDK if it is the seed tarball.
if [[ "$FLAGS_seed_tarball" == "${COREOS_SDK_TARBALL_PATH}" ]]; then
sdk_download_tarball
fi
# confirm seed exists
if [[ ! -f "$FLAGS_seed_tarball" ]]; then
@ -211,31 +205,6 @@ catalyst_init() {
fi
}
# search_for_sdk_seed
# As a fallback search around for an existing SDK tarball we
# can use as a seed when the default doesn't exist.
search_for_sdk_seed() {
# Search disabled
[[ "${SDK_SEARCH}" != 1 ]] && return
# Seed already exists
[[ -f "${FLAGS_seed_tarball}" ]] && return
# User set the option so we shouldn't change it
[[ "${FLAGS_seed_tarball}" != "${DEFAULT_SEED}" ]] && return
local check_path
for check_path in \
"${CATALYST_ROOT}/builds/coreos-sdk/${SDK_TARBALL}" \
"${CATALYST_ROOT}/builds/seeds/${SDK_TARBALL}" \
"${REPO_CACHE_DIR}/sdks/${SDK_TARBALL}" \
do
if [[ -f "${check_path}" ]]; then
info "Using SDK for seed: ${check_path}"
FLAGS_seed_tarball="${check_path}"
return
fi
done
}
write_configs() {
# No catalyst config option, so defined via environment
export CCACHE_DIR="$TEMPDIR/ccache"

View File

@ -8,9 +8,6 @@ SCRIPT_ROOT=$(dirname $(readlink -f "$0"))
. "${SCRIPT_ROOT}/common.sh" || exit 1
TYPE="coreos-toolchains"
ARCH=$(portageq envvar ARCH)
DEFAULT_SEED="builds/coreos-sdk/stage4-${ARCH}-latest.tar.bz2"
DEFAULT_PROFILE="coreos:default/linux/${ARCH}/10.0"
FORCE_STAGES="stage4"
. "${BUILD_LIBRARY_DIR}/catalyst.sh" || exit 1