diff --git a/build/tasks/kernel.mk b/build/tasks/kernel.mk index efc37360177d6c75b3a357fc0bd246d6e1afad1a..8ca69394110f0a3e578ca8c14590a9012da6af38 100644 --- a/build/tasks/kernel.mk +++ b/build/tasks/kernel.mk @@ -61,6 +61,9 @@ # modules in system instead of vendor # NEED_KERNEL_MODULE_VENDOR_OVERLAY = Optional, if true, install kernel # modules in vendor_overlay instead of vendor +# +# TARGET_FORCE_PREBUILT_KERNEL = Optional, use TARGET_PREBUILT_KERNEL even if +# kernel sources are present ifneq ($(TARGET_NO_KERNEL),true) @@ -159,8 +162,23 @@ else $(warning **********************************************************) $(error "NO KERNEL CONFIG") else - FULL_KERNEL_BUILD := true - KERNEL_BIN := $(TARGET_PREBUILT_INT_KERNEL) + ifneq ($(TARGET_FORCE_PREBUILT_KERNEL),) + $(warning **********************************************************) + $(warning * Kernel source found and configuration was defined, *) + $(warning * but prebuilt kernel is being forced. *) + $(warning * While this is likely intentional, *) + $(warning * it is NOT SUPPORTED WHATSOEVER. *) + $(warning * Generated kernel headers may not align with *) + $(warning * the ABI of kernel you're including. *) + $(warning * Please unset TARGET_FORCE_PREBUILT_KERNEL *) + $(warning * to build the kernel from source. *) + $(warning **********************************************************) + FULL_KERNEL_BUILD := false + KERNEL_BIN := $(TARGET_PREBUILT_KERNEL) + else + FULL_KERNEL_BUILD := true + KERNEL_BIN := $(TARGET_PREBUILT_INT_KERNEL) + endif endif endif diff --git a/config/BoardConfigKernel.mk b/config/BoardConfigKernel.mk index 43154d493d80511ce341ba66aa593ff740906df5..00971051c469c00ba71791adabc3b6b7aafbceb8 100644 --- a/config/BoardConfigKernel.mk +++ b/config/BoardConfigKernel.mk @@ -41,9 +41,6 @@ BUILD_TOP := $(shell pwd) TARGET_AUTO_KDIR := $(shell echo $(TARGET_DEVICE_DIR) | sed -e 's/^device/kernel/g') TARGET_KERNEL_SOURCE ?= $(TARGET_AUTO_KDIR) -ifneq ($(TARGET_PREBUILT_KERNEL),) -TARGET_KERNEL_SOURCE := -endif TARGET_KERNEL_ARCH := $(strip $(TARGET_KERNEL_ARCH)) ifeq ($(TARGET_KERNEL_ARCH),)