Support system_dlkm in GSI
From Android 13, all devices must include a system_dlkm partition.
The patch enables system_dlkm on all GSI targets to support the devices
with system_dlkm partition, and be compatible with old devices
without a system_dlkm partition.
With patch, there is no /system/system_dlkm, and add a symlink
/system/lib/modules -> /system_dlkm/lib/modules
Bug: 256984997
Test: make gsi_arm64-user and aosp_arm64-user; check system folder
Change-Id: I2453ec43d584423cc4d5f0e23405f0ae9b6c5c90
diff --git a/target/board/BoardConfigGsiCommon.mk b/target/board/BoardConfigGsiCommon.mk
index 8c634f6..98dea93 100644
--- a/target/board/BoardConfigGsiCommon.mk
+++ b/target/board/BoardConfigGsiCommon.mk
@@ -17,6 +17,12 @@
TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
TARGET_USERIMAGES_SPARSE_EROFS_DISABLED := true
+# Enable system_dlkm image for creating a symlink in GSI to support
+# the devices with system_dlkm partition
+BOARD_USES_SYSTEM_DLKMIMAGE := true
+BOARD_SYSTEM_DLKMIMAGE_FILE_SYSTEM_TYPE := ext4
+TARGET_COPY_OUT_SYSTEM_DLKM := system_dlkm
+
# GSI also includes make_f2fs to support userdata parition in f2fs
# for some devices
TARGET_USERIMAGES_USE_F2FS := true
diff --git a/target/product/gsi_release.mk b/target/product/gsi_release.mk
index 3705a50..09d4bc9 100644
--- a/target/product/gsi_release.mk
+++ b/target/product/gsi_release.mk
@@ -85,6 +85,7 @@
PRODUCT_BUILD_VENDOR_IMAGE := false
PRODUCT_BUILD_SUPER_PARTITION := false
PRODUCT_BUILD_SUPER_EMPTY_IMAGE := false
+PRODUCT_BUILD_SYSTEM_DLKM_IMAGE := false
PRODUCT_EXPORT_BOOT_IMAGE_TO_DIST := true
# Always build modules from source