Add generated prebuilt_* modules to high_priority_deps by default
Instead of opt-in via allowlist. This prevents any unforeseen packaging
conflicts issues in downstream branches.
Test: m product_config_to_bp && observe all generated modules are listed in high_priority_deps
Bug: 378298832
Change-Id: I6afde5f3285aa3a0f4d0d7c0c22a4ca6111707c0
diff --git a/fsgen/fsgen_mutators.go b/fsgen/fsgen_mutators.go
index 1253f0d..e0e103a 100644
--- a/fsgen/fsgen_mutators.go
+++ b/fsgen/fsgen_mutators.go
@@ -66,6 +66,8 @@
fsDepsMutex sync.Mutex
// Map of _all_ soong module names to their corresponding installation properties
moduleToInstallationProps map[string]installationProperties
+ // List of prebuilt_* modules that are autogenerated.
+ generatedPrebuiltEtcModuleNames []string
}
type installationProperties struct {
@@ -174,8 +176,9 @@
},
"ramdisk": {},
},
- fsDepsMutex: sync.Mutex{},
- moduleToInstallationProps: map[string]installationProperties{},
+ fsDepsMutex: sync.Mutex{},
+ moduleToInstallationProps: map[string]installationProperties{},
+ generatedPrebuiltEtcModuleNames: generatedPrebuiltEtcModuleNames,
}
if avbpubkeyGenerated {
@@ -284,7 +287,7 @@
soongGeneratedPartitionMap := getAllSoongGeneratedPartitionNames(mctx.Config(), fsGenState.soongGeneratedPartitions)
m := mctx.Module()
if partition, ok := soongGeneratedPartitionMap[m.Name()]; ok {
- depsStruct := generateDepStruct(*fsDeps[partition])
+ depsStruct := generateDepStruct(*fsDeps[partition], fsGenState.generatedPrebuiltEtcModuleNames)
if err := proptools.AppendMatchingProperties(m.GetProperties(), depsStruct, nil); err != nil {
mctx.ModuleErrorf(err.Error())
}
@@ -343,12 +346,12 @@
return false
}
-func generateDepStruct(deps map[string]*depCandidateProps) *packagingPropsStruct {
+func generateDepStruct(deps map[string]*depCandidateProps, highPriorityDeps []string) *packagingPropsStruct {
depsStruct := packagingPropsStruct{}
for depName, depProps := range deps {
bitness := getBitness(depProps.Arch)
fullyQualifiedDepName := fullyQualifiedModuleName(depName, depProps.Namespace)
- if isHighPriorityDep(depName) {
+ if android.InList(depName, highPriorityDeps) {
depsStruct.High_priority_deps = append(depsStruct.High_priority_deps, fullyQualifiedDepName)
} else if android.InList("32", bitness) && android.InList("64", bitness) {
// If both 32 and 64 bit variants are enabled for this module