From a9592e9bfa32bb7f78ab9aa3f84264c2c2e5f962 Mon Sep 17 00:00:00 2001 From: Adithya R Date: Wed, 9 Aug 2023 15:59:16 +0530 Subject: [PATCH] dlkm: Allow vendor ramdisk modules in its own subdir Keeps the prebuilt kernel tree clean. Change-Id: Ia162b6911f06ccac22c976e1aa7398f616edd136 --- dlkm/kernel-platform.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dlkm/kernel-platform.mk b/dlkm/kernel-platform.mk index ece47219..7afd3269 100644 --- a/dlkm/kernel-platform.mk +++ b/dlkm/kernel-platform.mk @@ -32,10 +32,16 @@ endef prepend-kernel-modules = $(eval $1 := $2 $(filter-out $2,$($1))) +ifneq ($(wildcard $(KERNEL_PREBUILT_DIR)/vendor_ramdisk/),) +first_stage_modules := $(call get-kernel-modules,vendor_ramdisk,modules.load) +recovery_modules := $(call get-kernel-modules,vendor_ramdisk,modules.load.recovery) +else first_stage_modules := $(call get-kernel-modules,.,modules.load) +recovery_modules := $(call get-kernel-modules,.,modules.load.recovery) +endif + gki_modules := $(call get-kernel-modules,system_dlkm,modules.load) second_stage_modules := $(call get-kernel-modules,vendor_dlkm,modules.load) -recovery_modules := $(call get-kernel-modules,.,modules.load.recovery) $(call prepend-kernel-modules,BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD,$(first_stage_modules)) $(call prepend-kernel-modules,BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD,$(recovery_modules))