预编译内核-mi2

第一.这个配置

AndroidBoard.mk

LOCAL_PATH := $(cal my-dir)
#————————————-
# linux kernel compile
# ———————————–
#
TARGET_KERNEL_SOURCE := kernel/xiaomi/aries
ifeq ($(KERNEL_DEFCONFIG),)
ifeq ($(TARGET_BUILD_VARIANT),eng)
#    KERNEL_DEFCONFIG := aries-perf-eng_defconfig
KERNEL_DEFCONFIG := aries-perf-usr_defconfig
else
KERNEL_DEFCONFIG := aries-perf-usr_defconfig
endif

ifneq ($(BUILD_KERNEL),true)
include device/xiaomi/aries/kernel/AndroidKernel.mk
else
include kernel/xiaomi/aries/AndroidKernel.mk
endif

$(INSTALLED_KERNEL_TARGET): $(TARGET_PREBUILT_KERNEL) | $(ACP) $(TARGET_PREBUILT_KERNEL_INCLUDE)
$(transform-prebuilt-to-target)
endif

第二.这个配置

AndroidKernel.mk

ifneq ($(BUILD_KERNEL),true)
ifneq ($(TARGET_PREBUILT_KERNEL),)
LOCAL_PRIVATE_PATH := device/xiaomi/aries/kernel

KERNEL_OUT := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
TARGET_PREBUILT_KERNEL_INCLUDE:=$(KERNEL_OUT)
$(TARGET_PREBUILT_KERNEL_INCLUDE):
echo $(LOCAL_PRIVATE_PATH) $(TARGET_PREBUILT_KERNEL)
mkdir -p $(KERNEL_OUT)
-cp -rf $(LOCAL_PRIVATE_PATH)/include/* $(KERNEL_OUT)/
else
TARGET_PREBUILT_KERNEL_INCLUDE:=
endif
endif

 

第三.因为这里面多了这个:

build\core\config.mk
# Boards may be defined under $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)
# or under vendor/*/$(TARGET_DEVICE).  Search in both places, but
# make sure only one exists.
# Real boards should always be associated with an OEM vendor.
board_config_mk := \
$(strip $(wildcard \
$(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)/BoardConfig.mk \
$(shell test -d device && find device -maxdepth 4 -path ‘*/$(TARGET_DEVICE)/BoardConfig.mk’) \
$(shell test -d vendor && find vendor -maxdepth 4 -path ‘*/$(TARGET_DEVICE)/BoardConfig.mk’) \
))
ifeq ($(board_config_mk),)
$(error No config file found for TARGET_DEVICE $(TARGET_DEVICE))
endif
ifneq ($(words $(board_config_mk)),1)
$(error Multiple board config files for TARGET_DEVICE $(TARGET_DEVICE): $(board_config_mk))
endif
include $(board_config_mk)
ifeq ($(TARGET_ARCH),)
$(error TARGET_ARCH not defined by board config: $(board_config_mk))
endif
TARGET_DEVICE_DIR := $(patsubst %/,%,$(dir $(board_config_mk)))
board_config_mk :=

# Perhaps we should move this block to build/core/Makefile,
# once we don’t have TARGET_NO_KERNEL reference in AndroidBoard.mk/Android.mk.
ifneq ($(strip $(TARGET_NO_BOOTLOADER)),true)
INSTALLED_BOOTLOADER_MODULE := $(PRODUCT_OUT)/bootloader
ifeq ($(strip $(TARGET_BOOTLOADER_IS_2ND)),true)
INSTALLED_2NDBOOTLOADER_TARGET := $(PRODUCT_OUT)/2ndbootloader
else
INSTALLED_2NDBOOTLOADER_TARGET :=
endif
else
INSTALLED_BOOTLOADER_MODULE :=
INSTALLED_2NDBOOTLOADER_TARGET :=
endif # TARGET_NO_BOOTLOADER
ifneq ($(strip $(TARGET_NO_KERNEL)),true)
INSTALLED_KERNEL_TARGET := $(PRODUCT_OUT)/kernel
else
INSTALLED_KERNEL_TARGET :=
endif