g12: Properly build external kernel modules
authorBruno Martins <bgcngm@gmail.com>
Sat, 16 Dec 2023 19:20:24 +0000 (19:20 +0000)
committerBruno Martins <bgcngm@gmail.com>
Sun, 7 Jul 2024 22:01:48 +0000 (23:01 +0100)
Change-Id: Ie632cdc1e2567606bcd10b7816fa65ad6090a038

BoardConfigCommon.mk
g12.mk
lineage.dependencies

index 4e0e4d1d7c8741a6fae766027226babeb7509ecb..c077bf9ac30a040363476306d7691a7ec9be95df 100644 (file)
@@ -6,9 +6,6 @@
 
 COMMON_PATH := device/amlogic/g12-common
 
-# GPU
-TARGET_AMLOGIC_GPU_ARCH ?= bifrost
-
 ## HIDL
 DEVICE_MANIFEST_FILE += $(COMMON_PATH)/manifest.xml
 
@@ -22,6 +19,20 @@ ifeq ($(WITH_CONSOLE),true)
 BOARD_KERNEL_CMDLINE += console=ttyS0,115200 no_console_suspend
 endif
 
+## Kernel modules
+TARGET_KERNEL_EXT_MODULE_ROOT := kernel/amlogic/kernel-modules
+TARGET_KERNEL_EXT_MODULES += \
+    mali-driver/bifrost \
+    media-4.9
+
+ifneq ($(TARGET_HAS_TEE),false)
+TARGET_KERNEL_EXT_MODULES += \
+    optee
+endif
+
+TARGET_MODULE_ALIASES += \
+    mali_kbase.ko:mali.ko
+
 ## Partitions
 SSI_PARTITIONS := product system system_ext
 TREBLE_PARTITIONS := odm vendor
diff --git a/g12.mk b/g12.mk
index 57ee93fd98c75f500446e7ffb7d31fe421d182eb..717c88ced3bfdfd71f75a3d29aba823e18e3d6bb 100644 (file)
--- a/g12.mk
+++ b/g12.mk
@@ -102,16 +102,6 @@ PRODUCT_COPY_FILES += \
 PRODUCT_PACKAGES += \
     fstab.amlogic
 
-## Kernel Modules
-PRODUCT_PACKAGES += \
-    mali \
-    media
-
-ifneq ($(TARGET_HAS_TEE),false)
-PRODUCT_PACKAGES += \
-    optee-module
-endif
-
 ## Keymaster
 ifneq ($(TARGET_HAS_TEE),false)
 PRODUCT_PACKAGES += \
index 64edb06adafe2b00289783c7e6c3c3970e7cf63b..c282a452f4451f6fb1856bc8641658a52c7dfd2e 100644 (file)
@@ -5,15 +5,15 @@
   },
   {
     "repository": "android_hardware_amlogic_kernel-modules_mali-driver",
-    "target_path": "hardware/amlogic/kernel-modules/mali-driver"
+    "target_path": "kernel/amlogic/kernel-modules/mali-driver"
   },
   {
     "repository": "android_hardware_amlogic_kernel-modules_media",
-    "target_path": "hardware/amlogic/kernel-modules/media"
+    "target_path": "kernel/amlogic/kernel-modules/media-4.9"
   },
   {
     "repository": "android_hardware_amlogic_kernel-modules_optee",
-    "target_path": "hardware/amlogic/kernel-modules/optee"
+    "target_path": "kernel/amlogic/kernel-modules/optee"
   },
   {
     "repository": "android_kernel_amlogic_linux-4.9",