summaryrefslogtreecommitdiff
path: root/fsgen/filesystem_creator.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2024-11-05 23:27:03 +0000
committer Spandan Das <spandandas@google.com> 2024-11-06 03:00:13 +0000
commit4cd93b516be2310c18466ab751cf9fd6e371130f (patch)
tree6741ac2880ebd94395c22781166719e338d0f78e /fsgen/filesystem_creator.go
parentc32e046107290710e18083772dd187e13e896a2f (diff)
Autogenerate an android_info module for vendor build.prop
vendor build.prop contains additional board specific properties. An android_info module will be autogenerated and added as a dep of the autogenerated vendor-build.prop The autogenerated module will be created in the root directory, to avoid complexities such as 1. Creation of additional filegroups if `TARGET_BOARD_INFO_FILES` are distributed throughout the tree 2. Scenarios where the filegroups are in a directory that that is outside the root soong namespace. Bug: 375500423 Test: verified that vendor/build.prop is same for kati and soong for `oriole` (modulo timestamp diffs) Change-Id: I038a6fc5a5ad87de3cd987be5bdfdbbb1384d0e5
Diffstat (limited to 'fsgen/filesystem_creator.go')
-rw-r--r--fsgen/filesystem_creator.go62
1 files changed, 45 insertions, 17 deletions
diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go
index d8f679f82..242ab512a 100644
--- a/fsgen/filesystem_creator.go
+++ b/fsgen/filesystem_creator.go
@@ -799,23 +799,7 @@ func (f *filesystemCreator) createPartition(ctx android.LoadHookContext, partiti
}
module.HideFromMake()
if partitionType == "vendor" {
- // Create a build prop for vendor
- vendorBuildProps := &struct {
- Name *string
- Vendor *bool
- Stem *string
- Product_config *string
- }{
- Name: proptools.StringPtr(generatedModuleName(ctx.Config(), "vendor-build.prop")),
- Vendor: proptools.BoolPtr(true),
- Stem: proptools.StringPtr("build.prop"),
- Product_config: proptools.StringPtr(":product_config"),
- }
- vendorBuildProp := ctx.CreateModule(
- android.BuildPropFactory,
- vendorBuildProps,
- )
- vendorBuildProp.HideFromMake()
+ f.createVendorBuildProp(ctx)
}
return true
}
@@ -855,6 +839,50 @@ func (f *filesystemCreator) createPrebuiltKernelModules(ctx android.LoadHookCont
}
}
+// Create a build_prop and android_info module. This will be used to create /vendor/build.prop
+func (f *filesystemCreator) createVendorBuildProp(ctx android.LoadHookContext) {
+ // Create a android_info for vendor
+ // The board info files might be in a directory outside the root soong namespace, so create
+ // the module in "."
+ partitionVars := ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse
+ androidInfoProps := &struct {
+ Name *string
+ Board_info_files []string
+ Bootloader_board_name *string
+ }{
+ Name: proptools.StringPtr(generatedModuleName(ctx.Config(), "android-info.prop")),
+ Board_info_files: partitionVars.BoardInfoFiles,
+ }
+ if len(androidInfoProps.Board_info_files) == 0 {
+ androidInfoProps.Bootloader_board_name = proptools.StringPtr(partitionVars.BootLoaderBoardName)
+ }
+ androidInfoProp := ctx.CreateModuleInDirectory(
+ android.AndroidInfoFactory,
+ ".",
+ androidInfoProps,
+ )
+ androidInfoProp.HideFromMake()
+ // Create a build prop for vendor
+ vendorBuildProps := &struct {
+ Name *string
+ Vendor *bool
+ Stem *string
+ Product_config *string
+ Android_info *string
+ }{
+ Name: proptools.StringPtr(generatedModuleName(ctx.Config(), "vendor-build.prop")),
+ Vendor: proptools.BoolPtr(true),
+ Stem: proptools.StringPtr("build.prop"),
+ Product_config: proptools.StringPtr(":product_config"),
+ Android_info: proptools.StringPtr(":" + androidInfoProp.Name()),
+ }
+ vendorBuildProp := ctx.CreateModule(
+ android.BuildPropFactory,
+ vendorBuildProps,
+ )
+ vendorBuildProp.HideFromMake()
+}
+
// createLinkerConfigSourceFilegroups creates filegroup modules to generate linker.config.pb for the following partitions
// 1. vendor: Using PRODUCT_VENDOR_LINKER_CONFIG_FRAGMENTS (space separated file list)
// 1. product: Using PRODUCT_PRODUCT_LINKER_CONFIG_FRAGMENTS (space separated file list)