Add _dlkm properties to `android_device`

android_device will use these props to include the _dlkm files (.ko
kernel files, modules.dep, ...) in target_files.zip

Test: m out/soong/.intermediates/build/soong/fsgen/aosp_cf_x86_64_phone_generated_device/android_common/target_files.zip
Bug: 385383524
Change-Id: Id62585f9bf0ea0480ed80898bac84dbd94dc8c8f
diff --git a/filesystem/android_device.go b/filesystem/android_device.go
index 666aa68..0a7b701 100644
--- a/filesystem/android_device.go
+++ b/filesystem/android_device.go
@@ -44,6 +44,12 @@
 	Vbmeta_partitions []string
 	// Name of the userdata partition filesystem module
 	Userdata_partition_name *string
+	// Name of the system_dlkm partition filesystem module
+	System_dlkm_partition_name *string
+	// Name of the vendor_dlkm partition filesystem module
+	Vendor_dlkm_partition_name *string
+	// Name of the odm_dlkm partition filesystem module
+	Odm_dlkm_partition_name *string
 }
 
 type androidDevice struct {
@@ -79,6 +85,9 @@
 	addDependencyIfDefined(a.partitionProps.Vendor_partition_name)
 	addDependencyIfDefined(a.partitionProps.Odm_partition_name)
 	addDependencyIfDefined(a.partitionProps.Userdata_partition_name)
+	addDependencyIfDefined(a.partitionProps.System_dlkm_partition_name)
+	addDependencyIfDefined(a.partitionProps.Vendor_dlkm_partition_name)
+	addDependencyIfDefined(a.partitionProps.Odm_dlkm_partition_name)
 	for _, vbmetaPartition := range a.partitionProps.Vbmeta_partitions {
 		ctx.AddDependency(ctx.Module(), filesystemDepTag, vbmetaPartition)
 	}
@@ -96,11 +105,14 @@
 	builder.Command().Textf("rm -rf %s", targetFilesDir.String())
 	builder.Command().Textf("mkdir -p %s", targetFilesDir.String())
 	partitionToSubdir := map[*string]string{
-		a.partitionProps.System_partition_name:     "SYSTEM",
-		a.partitionProps.System_ext_partition_name: "SYSTEM_EXT",
-		a.partitionProps.Product_partition_name:    "PRODUCT",
-		a.partitionProps.Vendor_partition_name:     "VENDOR",
-		a.partitionProps.Odm_partition_name:        "ODM",
+		a.partitionProps.System_partition_name:      "SYSTEM",
+		a.partitionProps.System_ext_partition_name:  "SYSTEM_EXT",
+		a.partitionProps.Product_partition_name:     "PRODUCT",
+		a.partitionProps.Vendor_partition_name:      "VENDOR",
+		a.partitionProps.Odm_partition_name:         "ODM",
+		a.partitionProps.System_dlkm_partition_name: "SYSTEM_DLKM",
+		a.partitionProps.Vendor_dlkm_partition_name: "VENDOR_DLKM",
+		a.partitionProps.Odm_dlkm_partition_name:    "ODM_DLKM",
 	}
 	for partition, subdir := range partitionToSubdir {
 		if partition == nil {
diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go
index 0160159..de9e5c2 100644
--- a/fsgen/filesystem_creator.go
+++ b/fsgen/filesystem_creator.go
@@ -214,6 +214,15 @@
 	if android.InList("recovery", f.properties.Generated_partition_types) {
 		partitionProps.Recovery_partition_name = proptools.StringPtr(generatedModuleNameForPartition(ctx.Config(), "recovery"))
 	}
+	if android.InList("system_dlkm", f.properties.Generated_partition_types) {
+		partitionProps.System_dlkm_partition_name = proptools.StringPtr(generatedModuleNameForPartition(ctx.Config(), "system_dlkm"))
+	}
+	if android.InList("vendor_dlkm", f.properties.Generated_partition_types) {
+		partitionProps.Vendor_dlkm_partition_name = proptools.StringPtr(generatedModuleNameForPartition(ctx.Config(), "vendor_dlkm"))
+	}
+	if android.InList("odm_dlkm", f.properties.Generated_partition_types) {
+		partitionProps.Odm_dlkm_partition_name = proptools.StringPtr(generatedModuleNameForPartition(ctx.Config(), "odm_dlkm"))
+	}
 	if f.properties.Boot_image != "" {
 		partitionProps.Boot_partition_name = proptools.StringPtr(generatedModuleNameForPartition(ctx.Config(), "boot"))
 	}