diff options
author | 2025-03-20 18:26:03 +0000 | |
---|---|---|
committer | 2025-03-21 20:17:39 +0000 | |
commit | a9e6b29feef1d0a1ffc56931f2632087677073d9 (patch) | |
tree | 84aae39da05459d92dd8ecd06bcc939aca793e0c /filesystem/bootimg.go | |
parent | 2e1338e23f64c8560110a802bef4e1887419aa4f (diff) |
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
Diffstat (limited to 'filesystem/bootimg.go')
-rw-r--r-- | filesystem/bootimg.go | 8 |
1 files changed, 8 insertions, 0 deletions
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()) |