diff options
author | 2025-03-21 14:56:47 -0700 | |
---|---|---|
committer | 2025-03-21 14:56:47 -0700 | |
commit | 780dd8642a6f35c5b0b6810713fc874f8c52c827 (patch) | |
tree | 5471141c34f5e3a2abf948a0e492a9fc5e1dd844 /filesystem/filesystem.go | |
parent | 07638f131eafac3cf915cbeb5d1003037347c41d (diff) | |
parent | a9e6b29feef1d0a1ffc56931f2632087677073d9 (diff) |
Merge "Create avb_recovery_add_hash_footer_args entry in misc_info.txt" into main
Diffstat (limited to 'filesystem/filesystem.go')
-rw-r--r-- | filesystem/filesystem.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index e86ebf4fa..d53cc816e 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -463,6 +463,9 @@ type FilesystemInfo struct { AvbAlgorithm string AvbHashAlgorithm string AvbKey android.Path + PartitionName string + // HasOrIsRecovery returns true for recovery and for ramdisks with a recovery partition. + HasOrIsRecovery bool } // FullInstallPathInfo contains information about the "full install" paths of all the files @@ -720,6 +723,8 @@ func (f *filesystem) GenerateAndroidBuildActions(ctx android.ModuleContext) { HasFsverity: f.properties.Fsverity.Inputs.GetOrDefault(ctx, nil) != nil, PropFileForMiscInfo: propFileForMiscInfo, PartitionSize: f.properties.Partition_size, + PartitionName: f.partitionName(), + HasOrIsRecovery: f.hasOrIsRecovery(ctx), } if proptools.Bool(f.properties.Use_avb) { fsInfo.UseAvb = true @@ -1307,6 +1312,19 @@ func includeFilesInstalledFiles(ctx android.ModuleContext) (ret []depset.DepSet[ return } +func (f *filesystem) hasOrIsRecovery(ctx android.ModuleContext) bool { + if f.partitionName() == "recovery" { + return true + } + ret := false + ctx.VisitDirectDepsWithTag(interPartitionInstallDependencyTag, func(m android.Module) { + if fsProvider, ok := android.OtherModuleProvider(ctx, m, FilesystemProvider); ok && fsProvider.PartitionName == "recovery" { + ret = true + } + }) + return ret +} + func (f *filesystem) buildCpioImage( ctx android.ModuleContext, builder *android.RuleBuilder, |