summaryrefslogtreecommitdiff
path: root/fsgen/filesystem_creator.go
diff options
context:
space:
mode:
Diffstat (limited to 'fsgen/filesystem_creator.go')
-rw-r--r--fsgen/filesystem_creator.go30
1 files changed, 29 insertions, 1 deletions
diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go
index 7f5a0682b..d2f00cd26 100644
--- a/fsgen/filesystem_creator.go
+++ b/fsgen/filesystem_creator.go
@@ -128,6 +128,10 @@ func (f *filesystemCreator) createInternalModules(ctx android.LoadHookContext) {
f.properties.Unsupported_partition_types = append(f.properties.Unsupported_partition_types, partitionType)
}
}
+ finalSoongGeneratedPartitionNames := make([]string, 0, len(finalSoongGeneratedPartitions))
+ for _, partitionType := range finalSoongGeneratedPartitions {
+ finalSoongGeneratedPartitionNames = append(finalSoongGeneratedPartitionNames, generatedModuleNameForPartition(ctx.Config(), partitionType))
+ }
// Create android_info.prop
f.createAndroidInfo(ctx)
@@ -156,6 +160,24 @@ func (f *filesystemCreator) createInternalModules(ctx android.LoadHookContext) {
}
}
+ var systemOtherImageName string
+ if buildingSystemOtherImage(partitionVars) {
+ systemModule := generatedModuleNameForPartition(ctx.Config(), "system")
+ systemOtherImageName = generatedModuleNameForPartition(ctx.Config(), "system_other")
+ ctx.CreateModule(
+ filesystem.SystemOtherImageFactory,
+ &filesystem.SystemOtherImageProperties{
+ System_image: &systemModule,
+ Preinstall_dexpreopt_files_from: finalSoongGeneratedPartitionNames,
+ },
+ &struct {
+ Name *string
+ }{
+ Name: proptools.StringPtr(systemOtherImageName),
+ },
+ )
+ }
+
for _, x := range createVbmetaPartitions(ctx, finalSoongGeneratedPartitions) {
f.properties.Vbmeta_module_names = append(f.properties.Vbmeta_module_names, x.moduleName)
f.properties.Vbmeta_partition_names = append(f.properties.Vbmeta_partition_names, x.partitionName)
@@ -163,7 +185,7 @@ func (f *filesystemCreator) createInternalModules(ctx android.LoadHookContext) {
var superImageSubpartitions []string
if buildingSuperImage(partitionVars) {
- superImageSubpartitions = createSuperImage(ctx, finalSoongGeneratedPartitions, partitionVars)
+ superImageSubpartitions = createSuperImage(ctx, finalSoongGeneratedPartitions, partitionVars, systemOtherImageName)
f.properties.Super_image = ":" + generatedModuleNameForPartition(ctx.Config(), "super")
}
@@ -183,6 +205,12 @@ func generatedModuleNameForPartition(cfg android.Config, partitionType string) s
return generatedModuleName(cfg, fmt.Sprintf("%s_image", partitionType))
}
+func buildingSystemOtherImage(partitionVars android.PartitionVariables) bool {
+ // TODO: Recreate this logic from make instead of just depending on the final result variable:
+ // https://cs.android.com/android/platform/superproject/main/+/main:build/make/core/board_config.mk;l=429;drc=15a0df840e7093f65518003ab80cf24a3d9e8e6a
+ return partitionVars.BuildingSystemOtherImage
+}
+
func (f *filesystemCreator) createBootloaderFilegroup(ctx android.LoadHookContext) (string, bool) {
bootloaderPath := ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.PrebuiltBootloader
if len(bootloaderPath) == 0 {