diff options
author | 2025-02-28 09:48:28 +0000 | |
---|---|---|
committer | 2025-02-28 09:52:07 +0000 | |
commit | 3dfa17f31c8c310d220f6ff1df43d072659e3e68 (patch) | |
tree | 00eb9410f1f9059f6888663da48b3628776f6416 /fsgen | |
parent | 9da8a2dc1d3c8d09d6cf7cb69390ebbd60810476 (diff) |
Generate META/fastboot-info.txt file
Make packaging system generates META/fastboot-info.txt by
1. A checked-in fastboot-info file (TARGET_BOARD_FASTBOOT_INFO_FILE), OR
2. Generating a fastboot-info file from board config vars
This CL implements (1). Cuttlefish uses a checked-in fastboot-info.txt
file.
To implement this, a new property has been added to `android_device`
Test: Built Soong's META/fastboot-info.txt file locally
Bug: 399788523
Change-Id: Iadef020b1144ec72efc3bc3c7020fe63b6c47d4a
Diffstat (limited to 'fsgen')
-rw-r--r-- | fsgen/filesystem_creator.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go index 3d83706a3..d286c6641 100644 --- a/fsgen/filesystem_creator.go +++ b/fsgen/filesystem_creator.go @@ -340,6 +340,26 @@ func (f *filesystemCreator) createReleaseToolsFilegroup(ctx android.LoadHookCont return releaseToolsFilegroupName, true } +func (f *filesystemCreator) createFastbootInfoFilegroup(ctx android.LoadHookContext) (string, bool) { + fastbootInfoFile := ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.BoardFastbootInfoFile + if fastbootInfoFile == "" { + return "", false + } + + fastbootInfoFilegroupName := generatedModuleName(ctx.Config(), "fastboot") + filegroupProps := &struct { + Name *string + Srcs []string + Visibility []string + }{ + Name: proptools.StringPtr(fastbootInfoFilegroupName), + Srcs: []string{fastbootInfoFile}, + Visibility: []string{"//visibility:public"}, + } + ctx.CreateModuleInDirectory(android.FileGroupFactory, ".", filegroupProps) + return fastbootInfoFilegroupName, true +} + func (f *filesystemCreator) createDeviceModule( ctx android.LoadHookContext, partitions allGeneratedPartitionData, @@ -413,6 +433,9 @@ func (f *filesystemCreator) createDeviceModule( if releaseTools, ok := f.createReleaseToolsFilegroup(ctx); ok { deviceProps.Releasetools_extension = proptools.StringPtr(":" + releaseTools) } + if fastbootInfo, ok := f.createFastbootInfoFilegroup(ctx); ok { + deviceProps.FastbootInfo = proptools.StringPtr(":" + fastbootInfo) + } ctx.CreateModule(filesystem.AndroidDeviceFactory, baseProps, partitionProps, deviceProps) } |