diff options
author | 2025-01-16 19:09:03 -0800 | |
---|---|---|
committer | 2025-01-16 19:09:03 -0800 | |
commit | b15ead941d7575bfc91841f23c26c99413bb9864 (patch) | |
tree | 67c31396392e0501602d658576979ecdb63ca571 /fsgen/filesystem_creator.go | |
parent | 315e7e84a2f4cf6b8c909d51fe169e65bce451a4 (diff) | |
parent | b8e280f886c1095c8a7e35cf88c4265c2b55f173 (diff) |
Merge changes from topic "system_other_img_soong_only" into main
* changes:
Install odex/vdex files into soong-built system_other
Build system_other image in soong-only builds
Diffstat (limited to 'fsgen/filesystem_creator.go')
-rw-r--r-- | fsgen/filesystem_creator.go | 30 |
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 { |