diff options
author | 2025-01-16 14:55:35 -0800 | |
---|---|---|
committer | 2025-01-16 16:20:24 -0800 | |
commit | 74ee4e0adc7fb37d648b86852cae93746556e02e (patch) | |
tree | 9b56d0230554e90486e7bd57d96a6978bb42b1a7 /fsgen/filesystem_creator.go | |
parent | feb2479506afeb4bf1e8b52a0f5edd21a420280b (diff) |
Build system_other image in soong-only builds
This just builds an empty system_other image for now, the dexpreopt
files will be added in a followup change.
Bug: 390269431
Test: m --soong-only
Change-Id: Ic4a9bcb8b7ba1eb4444b3339d6c0b0cdfd485714
Diffstat (limited to 'fsgen/filesystem_creator.go')
-rw-r--r-- | fsgen/filesystem_creator.go | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go index d00ebb217..616607468 100644 --- a/fsgen/filesystem_creator.go +++ b/fsgen/filesystem_creator.go @@ -156,6 +156,23 @@ 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, + }, + &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 +180,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 +200,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 { |