I'm doing it like that (my case is Marlin (Pixel, Pixel XL), AOSP 8.1), don't know anything about Pie and later.
1. Download the kernel for msm, checkout the proper branch
2. Rename the kernel checkout directory to "marlin" and place it to kernel/google/ in the AOSP tree,
3. Open AndroidKernel.mk and find lines:
TARGET_KERNEL := msm-$(TARGET_KERNEL_VERSION)
ifeq ($(TARGET_KERNEL),$(current_dir))
# New style, kernel/msm-version
BUILD_ROOT_LOC := ../../
TARGET_KERNEL_SOURCE := kernel/$(TARGET_KERNEL)
KERNEL_OUT := $(TARGET_OUT_INTERMEDIATES)/kernel/$(TARGET_KERNEL)
KERNEL_SYMLINK := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
KERNEL_USR := $(KERNEL_SYMLINK)/usr
else
# Legacy style, kernel source directly under kernel
KERNEL_LEGACY_DIR := true
BUILD_ROOT_LOC := ../
TARGET_KERNEL_SOURCE := kernel
KERNEL_OUT := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
endif
and change them to
TARGET_KERNEL := google/marlin
BUILD_ROOT_LOC := ../../../
4. In device/google/marlin make a new file called AndroidBoard.mk with the following content:
#ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
#KERNEL_DEFCONFIG := marlin-debug_defconfig
#else
KERNEL_DEFCONFIG := marlin_defconfig
#endif
KERNEL_DIR := kernel/google/marlin
TARGET_KERNEL_APPEND_DTB := true
include $(TOP)/$(KERNEL_DIR)/AndroidKernel.mk
.PHONY: $(PRODUCT_OUT)/kernel
$(PRODUCT_OUT)/kernel: $(TARGET_PREBUILT_KERNEL)
cp $(TARGET_PREBUILT_KERNEL) $(PRODUCT_OUT)/kernel
uncomment the condition on the top if you need.
5. In device/google/marlin/
device-common.mk find lines:
ifeq ($(TARGET_PREBUILT_KERNEL),)
LOCAL_KERNEL := device/google/marlin-kernel/Image.lz4-dtb
else
LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
endif
PRODUCT_COPY_FILES += \
$(LOCAL_KERNEL):kernel
and delete them.
6. In device/google/marlin/marlin and device/google/marlin/sailfish make a symlink AndroidBoard.mk -> device/google/marlin/AndroidBoard.mk
7. I don't know exactly, but if you really need, you can try to uncomment the line in BoardConfig.mk
# TARGET_COMPILE_WITH_MSM_KERNEL := true
to make your condition work. I never did that so can't say if it works.
BTW: Personally I don't know if Pie is different about compiling kernels. I see the same conditions about prebuilt kernels as in Oreo.
понедельник, 9 сентября 2019 г., 4:23:23 UTC+3 пользователь Clienthax написал: