summaryrefslogtreecommitdiff
path: root/BoardConfig.mk
diff options
context:
space:
mode:
authorSam Protsenko <semen.protsenko@linaro.org>2019-03-19 15:21:27 +0200
committerSam Protsenko <semen.protsenko@linaro.org>2019-05-31 20:42:40 +0300
commit85dba6339564c01e59a278230403b1fca44ff1a8 (patch)
tree13f5cdfa8183344fb6a76ce997eb2e364ab649e7 /BoardConfig.mk
parente7f274fe982aed40838ecb512c5607e13727decd (diff)
downloadbeagle-x15-85dba6339564c01e59a278230403b1fca44ff1a8.tar.gz
beagle_x15: Copy kernel modules to vendor partition
In order to make some subsystems functional (e.g. touchscreen, sound), corresponding kernel modules (.ko) should be dynamically loaded. It can be done automatically by ueventd daemon, thanks to this patch in system/core: ueventd: Add dynamic kernel module loading *This* patch implements kernel modules copying into /vendor/lib/modules: - if KERNELDIR environment variable is defined, then *.ko files will be copied from locally built kernel in KERNELDIR - otherwise *.ko files will be copied from prebuilt kernel dir Right now we don't have *.ko files in prebuilt kernel dir, so some functionality is missing (touchscreen, sound). It should be out next step to add all required *.ko there. Corresponding modules.dep and modules.alias files are generated automatically by Android build system, in build/make project, thanks to next commits: - Support kernel modules in vendor, recovery images - package modules.alias onto device Now that SGX kernel module can be built inside of Linux kernel source tree, so it will be copied along with other *.ko files. This way we can avoid disagreement between kernel version and SGX module version, when using locally built kernel from KERNELDIR. Also we want to warn the user if SGX module is not available, as graphics won't work in this case. While at it, provide the correct mechanism for copying dtb/dtbo files from locally built kernel when KERNELDIR is defined. A few points about implementation: 1. In boot_fit/Android.mk file, before *.dtbo copying the check for *.dtbo existence is done: ifneq ($(wildcard $(DTBO_DIR)/*.dtbo),) cp $(DTBO_DIR)/*.dtbo $(PRIVATE_INTERMEDIATES)/ endif This is needed because when using linux-mainline in KERNELDIR, next error will occur (because linux-mainline doesn't have *.dtbo files): FAILED: out/target/product/beagle_x15/boot_fit.img cp: bad '.../linux-mainline/arch/arm/boot/dts/ti/*.dtbo': No such file or directory For the same reason we don't provide $(wildcard $(DTBO_DIR)/*.dtbo) to $(BOOTIMG_FIT) target's prerequisites, like it's done for DTB_DIR (linux-mainline doesn't have dtbo's, os it's an optional dependency). 2. In BoardConfig.mk file, the BOARD_VENDOR_KERNEL_MODULES is assigned via intermediate BOARD_ALL_MODULES variable, because if we assign it directly to $(shell ...) command, next build error happens: [100% 359/359] writing build rules ... FAILED: build/make/core/Makefile:2807: error: kati doesn't support passing results of $(shell) to other make constructs: find .../linux -type f -iname '*.ko' All that said, we want (and we can, with this patch) to support AOSP build with next kernel options: 1. Prebuilt kernel from device/ti/beagle_x15-kernel/* 2. Locally built TI Android kernel as KERNELDIR 3. Locally built linux-mainline kernel as KERNELDIR As (1) is convenient for end user, options (2) and (3) is convenient for development. Change-Id: I3aee2da99ede252919e7f42f74f9ba25ec7d364c Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Diffstat (limited to 'BoardConfig.mk')
-rw-r--r--BoardConfig.mk13
1 files changed, 10 insertions, 3 deletions
diff --git a/BoardConfig.mk b/BoardConfig.mk
index f493fa2..47c8a51 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -69,6 +69,13 @@ TARGET_UBOOT_CONFIGS += device/ti/beagle_x15/beagle_x15_uboot.conf
TARGET_UBOOT_MAKE_TARGET := u-boot-img.bin
TARGET_UBOOT_COPY_TARGETS := u-boot.img MLO
-# Graphics
-BOARD_VENDOR_KERNEL_MODULES += \
- device/ti/beagle_x15-kernel/$(TARGET_KERNEL_USE)/pvrsrvkm.ko
+# Copy kernel modules (including pvrsrvkm.ko) into /vendor/lib/modules
+BOARD_ALL_MODULES := $(shell find $(LOCAL_KERNEL_HOME) -type f -iname '*.ko')
+BOARD_VENDOR_KERNEL_MODULES += $(BOARD_ALL_MODULES)
+
+# Check if SGX kernel module is present in chosen kernel directory
+SGX_KO := $(shell find $(LOCAL_KERNEL_HOME) -type f -name 'pvrsrvkm.ko')
+ifeq ($(SGX_KO),)
+ $(warning SGX module (pvrsrvkm.ko) not found, graphics won't work)
+ $(warning SGX module search path is: $(LOCAL_KERNEL_HOME))
+endif