From 250539a6dce0add34ecccd7bda749c27303bd2bc Mon Sep 17 00:00:00 2001 From: Ian Kasprzak Date: Wed, 8 May 2019 16:27:36 -0700 Subject: [PATCH] Walleye: Custom modules pickup When creating a product with TARGET_PREBUILT_KERNEL, allow to pick up modules that match the given kernel by looking for .ko and .dtb files in the same directory. This avoids further special-casing in the board config. Based on aosp/928183 Bug: 132196666 Test: m Test: manual (with get_build_var) Change-Id: I8f961255e90308a5d7d308f6da348f20f9020d20 --- device-common.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/device-common.mk b/device-common.mk index 35126e3..53c97d4 100644 --- a/device-common.mk +++ b/device-common.mk @@ -135,6 +135,17 @@ BOARD_VENDOR_KERNEL_MODULES += \ device/google/wahoo-kernel/debug_api/synaptics_dsx_fw_update_htc.ko \ device/google/wahoo-kernel/debug_api/htc_battery.ko \ device/google/wahoo-kernel/debug_api/wlan.ko +else ifneq (,$(TARGET_PREBUILT_KERNEL)) + # If TARGET_PREBUILT_KERNEL is set, check whether there are modules packaged with that kernel + # image. If so, use them, otherwise fall back to the default directory. + TARGET_PREBUILT_KERNEL_PREBUILT_VENDOR_KERNEL_MODULES := \ + $(wildcard $(dir $(TARGET_PREBUILT_KERNEL))/*.ko) + ifneq (,$(TARGET_PREBUILT_KERNEL_PREBUILT_VENDOR_KERNEL_MODULES)) + BOARD_VENDOR_KERNEL_MODULES += $(TARGET_PREBUILT_KERNEL_PREBUILT_VENDOR_KERNEL_MODULES) + else + BOARD_VENDOR_KERNEL_MODULES += $(wildcard device/google/wahoo-kernel/*.ko) + endif + # Do NOT delete TARGET_PREBUILT..., it will lead to empty BOARD_VENDOR_KERNEL_MODULES. else BOARD_VENDOR_KERNEL_MODULES += \ device/google/wahoo-kernel/synaptics_dsx_core_htc.ko \