summaryrefslogtreecommitdiff
path: root/fsgen/filesystem_creator.go
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-01-09 15:28:03 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-01-09 15:28:03 -0800
commitc44ef1df2141fe278e9fd1b3cba231f0fe4f8c43 (patch)
treefa1a25701aa7b7b1eceeae67ae0a8c156b418509 /fsgen/filesystem_creator.go
parent5af460fc21229c4b24d556d438454e54ac499341 (diff)
parent3be1716f397ab1777ba749f4f9891d3e6324bfd2 (diff)
Merge "Copy bootloader to PRODUCT_OUT" into main
Diffstat (limited to 'fsgen/filesystem_creator.go')
-rw-r--r--fsgen/filesystem_creator.go27
1 files changed, 26 insertions, 1 deletions
diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go
index 41faf948a..0fcb22f9e 100644
--- a/fsgen/filesystem_creator.go
+++ b/fsgen/filesystem_creator.go
@@ -180,6 +180,26 @@ func generatedModuleNameForPartition(cfg android.Config, partitionType string) s
return generatedModuleName(cfg, fmt.Sprintf("%s_image", partitionType))
}
+func (f *filesystemCreator) createBootloaderFilegroup(ctx android.LoadHookContext) (string, bool) {
+ bootloaderPath := ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.PrebuiltBootloader
+ if len(bootloaderPath) == 0 {
+ return "", false
+ }
+
+ bootloaderFilegroupName := generatedModuleName(ctx.Config(), "bootloader")
+ filegroupProps := &struct {
+ Name *string
+ Srcs []string
+ Visibility []string
+ }{
+ Name: proptools.StringPtr(bootloaderFilegroupName),
+ Srcs: []string{bootloaderPath},
+ Visibility: []string{"//visibility:public"},
+ }
+ ctx.CreateModuleInDirectory(android.FileGroupFactory, ".", filegroupProps)
+ return bootloaderFilegroupName, true
+}
+
func (f *filesystemCreator) createDeviceModule(
ctx android.LoadHookContext,
generatedPartitionTypes []string,
@@ -234,7 +254,12 @@ func (f *filesystemCreator) createDeviceModule(
}
partitionProps.Vbmeta_partitions = vbmetaPartitions
- ctx.CreateModule(filesystem.AndroidDeviceFactory, baseProps, partitionProps)
+ deviceProps := &filesystem.DeviceProperties{}
+ if bootloader, ok := f.createBootloaderFilegroup(ctx); ok {
+ deviceProps.Bootloader = proptools.StringPtr(":" + bootloader)
+ }
+
+ ctx.CreateModule(filesystem.AndroidDeviceFactory, baseProps, partitionProps, deviceProps)
}
func partitionSpecificFsProps(ctx android.EarlyModuleContext, fsProps *filesystem.FilesystemProperties, partitionVars android.PartitionVariables, partitionType string) {