From 0c0df75d690c3f287b92186fcbd2ccb7a714adf9 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Sun, 17 Nov 2013 22:45:34 -0800 Subject: [PATCH] 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). --- .../third_party/coreos-overlay/eclass/cros-kernel2.eclass | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sdk_container/src/third_party/coreos-overlay/eclass/cros-kernel2.eclass b/sdk_container/src/third_party/coreos-overlay/eclass/cros-kernel2.eclass index 9e66216f24..ea2322db51 100644 --- a/sdk_container/src/third_party/coreos-overlay/eclass/cros-kernel2.eclass +++ b/sdk_container/src/third_party/coreos-overlay/eclass/cros-kernel2.eclass @@ -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)"