fix(cros-kernel2.eclass): Disable OUTOFTREE_BUILD when src is dirty.

If OUTOFTREE_BUILD=1 (currently disabled but that will change) the
kernel will use the existing checkout as the source tree rather than
cloning another tree. If someone built anything in that tree and .config
exists the build will fail complaining that the source isn't clean.
Instead of failing just disable OUTOFTREE and emit a warning.

OUTOFTREE combined with INCREMENTAL makes successive kernel builds
pretty much no-ops (just re-linking modules and bzImage).
This commit is contained in:
Michael Marineau 2013-11-17 22:45:34 -08:00
parent c83821a102
commit 0c0df75d69

View File

@ -129,6 +129,14 @@ kmake() {
}
cros-kernel2_src_unpack() {
local srclocal="${CROS_WORKON_LOCALDIR[0]}/${CROS_WORKON_LOCALNAME[0]}"
local srcpath="${CROS_WORKON_SRCROOT}/${srclocal}"
if [[ -f "${srcpath}/.config" || -d "${srcpath}/include/config" ]]; then
ewarn "Local kernel source is not clean, disabling OUTOFTREE_BUILD"
elog "Please run 'make mrproper' in ${srclocal}"
CROS_WORKON_OUTOFTREE_BUILD=0
fi
cros-workon_src_unpack
local config="$(find_defconfig)"