From a9e6b29feef1d0a1ffc56931f2632087677073d9 Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Thu, 20 Mar 2025 18:26:03 +0000 Subject: Create avb_recovery_add_hash_footer_args entry in misc_info.txt This CL creates an additional avb_recovery_add_hash_footer_args entry for bootimages with a ramdisk that contains a recovery partition. strings.ReplaceAll will be used to convert ``` --prop com.android.build.vendor_boot.fingerprint:generic/aosp_cf_x86_64_phone/vsoc_x86_64:Baklava/MAIN/eng.spanda:userdebug/test-keys ``` to ``` --prop com.android.build.recovery.fingerprint:generic/aosp_cf_x86_64_phone/vsoc_x86_64:Baklava/MAIN/eng.spanda:userdebug/test-keys ``` Test: Built and diff'd locally Bug: 398036609 Change-Id: I0caa8aa9e2e86b9c78352d3038951e00f689dc1a --- filesystem/filesystem.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'filesystem/filesystem.go') diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index 411770be9..ad4366b2e 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, -- cgit v1.2.3-59-g8ed1b From f68322e3286becff1d006f557e5dc71afadcf26f Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Fri, 21 Mar 2025 21:02:46 +0000 Subject: Do not write avb_*_key_path of android_filesystem to misc_info.txt This matches the make packaging system implementaton. avb_*_key_path of bootimg, vbmeta and system_other will continue to be written to Soong built misc_info.txt Bug: 398036609 Test: Built and diff'd locally Change-Id: Ie2d4ad8362ce7f44d473ef185562c60718e173b3 --- filesystem/filesystem.go | 4 ---- 1 file changed, 4 deletions(-) (limited to 'filesystem/filesystem.go') diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index ad4366b2e..61b731ab2 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -1182,10 +1182,6 @@ func (f *filesystem) buildPropFileForMiscInfo(ctx android.ModuleContext) android if proptools.Bool(f.properties.Use_avb) { addStr("avb_"+f.partitionName()+"_hashtree_enable", "true") - if f.properties.Avb_private_key != nil { - key := android.PathForModuleSrc(ctx, *f.properties.Avb_private_key) - addStr("avb_"+f.partitionName()+"_key_path", key.String()) - } addStr("avb_"+f.partitionName()+"_add_hashtree_footer_args", strings.TrimSpace(f.getAvbAddHashtreeFooterArgs(ctx))) } -- cgit v1.2.3-59-g8ed1b