Do not attempt to generate prebuilt_kernel_modules if they are not src
Some configurations do not have checked-in prebuilt .ko files.
Test: go build ./fsgen
Bug: 379478434
Change-Id: Icd0febf2ccc59655a06b7382ffd102652bc6f2bb
diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go
index c74579a..dca44f0 100644
--- a/fsgen/filesystem_creator.go
+++ b/fsgen/filesystem_creator.go
@@ -320,7 +320,7 @@
}
switch partitionType {
case "system_dlkm":
- props.Srcs = ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.SystemKernelModules
+ props.Srcs = android.ExistentPathsForSources(ctx, ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.SystemKernelModules).Strings()
props.System_dlkm_specific = proptools.BoolPtr(true)
if len(ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.SystemKernelLoadModules) == 0 {
// Create empty modules.load file for system
@@ -331,7 +331,7 @@
props.Blocklist_file = proptools.StringPtr(blocklistFile)
}
case "vendor_dlkm":
- props.Srcs = ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.VendorKernelModules
+ props.Srcs = android.ExistentPathsForSources(ctx, ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.VendorKernelModules).Strings()
if len(ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.SystemKernelModules) > 0 {
props.System_deps = []string{":" + generatedModuleName(ctx.Config(), "system_dlkm-kernel-modules") + "{.modules}"}
}
@@ -340,7 +340,7 @@
props.Blocklist_file = proptools.StringPtr(blocklistFile)
}
case "odm_dlkm":
- props.Srcs = ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.OdmKernelModules
+ props.Srcs = android.ExistentPathsForSources(ctx, ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.OdmKernelModules).Strings()
props.Odm_dlkm_specific = proptools.BoolPtr(true)
if blocklistFile := ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.OdmKernelBlocklistFile; blocklistFile != "" {
props.Blocklist_file = proptools.StringPtr(blocklistFile)