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/bootimg.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'filesystem/bootimg.go') diff --git a/filesystem/bootimg.go b/filesystem/bootimg.go index 5ab0c6899..485eae47c 100644 --- a/filesystem/bootimg.go +++ b/filesystem/bootimg.go @@ -539,6 +539,14 @@ func (b *bootimg) buildPropFileForMiscInfo(ctx android.ModuleContext) android.Pa bootImgType := proptools.String(b.properties.Boot_image_type) addStr("avb_"+bootImgType+"_add_hash_footer_args", b.getAvbHashFooterArgs(ctx)) + if ramdisk := proptools.String(b.properties.Ramdisk_module); ramdisk != "" { + ramdiskModule := ctx.GetDirectDepWithTag(ramdisk, bootimgRamdiskDep) + fsInfo, _ := android.OtherModuleProvider(ctx, ramdiskModule, FilesystemProvider) + if fsInfo.HasOrIsRecovery { + // Create a dup entry for recovery + addStr("avb_recovery_add_hash_footer_args", strings.ReplaceAll(b.getAvbHashFooterArgs(ctx), bootImgType, "recovery")) + } + } if b.properties.Avb_private_key != nil { addStr("avb_"+bootImgType+"_algorithm", proptools.StringDefault(b.properties.Avb_algorithm, "SHA256_RSA4096")) addStr("avb_"+bootImgType+"_key_path", android.PathForModuleSrc(ctx, proptools.String(b.properties.Avb_private_key)).String()) -- cgit v1.2.3-59-g8ed1b