aosp_beryllium: Add GKI images support

Set USES_GKI=true to install prebuilt GKI Image.gz-dtb kernel
and kernel modules from prebuilt-kernel directory.

Signed-off-by: Amit Pundir <pundiramit@gmail.com>
diff --git a/aosp_beryllium.mk b/aosp_beryllium.mk
index 04ffb54..c4d640a 100644
--- a/aosp_beryllium.mk
+++ b/aosp_beryllium.mk
@@ -1,6 +1,17 @@
-# Kernel tree is hosted at https://github.com/pundiramit/linux/tree/display (beryllium_defconfig).
-# cat arch/arm64/boot/Image.gz arch/arm64/boot/dts/qcom/sdm845-beryllium.dtb > Image.gz-dtb-beryllium
-TARGET_PREBUILT_KERNEL ?= Image.gz-dtb-beryllium-5.2
+KERNEL_DIR := device/xiaomi/beryllium/prebuilt-kernel
+
+ifneq ($(USES_GKI), true)
+  # Kernel tree is hosted at https://github.com/pundiramit/linux/tree/display (beryllium_defconfig).
+  # cat arch/arm64/boot/Image.gz arch/arm64/boot/dts/qcom/sdm845-beryllium.dtb > Image.gz-dtb-beryllium
+  TARGET_PREBUILT_KERNEL ?= Image.gz-dtb-beryllium-5.2
+else
+  TARGET_PREBUILT_KERNEL ?= Image.gz-dtb
+  MODULES := $(wildcard $(KERNEL_DIR)/*.ko)
+  ifneq ($(MODULES),)
+    BOARD_VENDOR_KERNEL_MODULES += $(MODULES)
+    BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(MODULES)
+  endif
+endif
 
 # Inherit the full_base and device configurations
 $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)