summaryrefslogtreecommitdiff
path: root/filesystem
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2025-03-18 03:02:03 +0000
committer Spandan Das <spandandas@google.com> 2025-03-18 16:50:30 +0000
commitbb15b74dfeaaa1df6e4552a8d8428a7178c0a4d7 (patch)
treee193c453a14080066ee3dfc8f8b0f26db774f27d /filesystem
parent65bcd97dbce6aee8aac13193d5d30742903afbda (diff)
Add more entries to Soong's misc_info.txt
Note that `erofs_default_compress_hints` is different between make and soong. For CF, the former has value of `device/google/cuttlefish/shared/erofs_compress_hints.txt`, while the latter has the value of `build/make/target/product/generic/erofs_compress_hints.txt`. The contents of both these hint files are same. Test: Built and diff'd locally Bug: 398036609 Change-Id: If02923f6bdb7a53b5158c5960c0494da71473bc1
Diffstat (limited to 'filesystem')
-rw-r--r--filesystem/android_device.go24
1 files changed, 23 insertions, 1 deletions
diff --git a/filesystem/android_device.go b/filesystem/android_device.go
index 11c0834ec..28ecd5345 100644
--- a/filesystem/android_device.go
+++ b/filesystem/android_device.go
@@ -753,12 +753,28 @@ func (a *androidDevice) copyMetadataToTargetZip(ctx android.ModuleContext, build
// This file is subsequently used by add_img_to_target_files to create additioanl metadata files like apex_info.pb
// TODO (b/399788119): Complete the migration of misc_info.txt
func (a *androidDevice) addMiscInfo(ctx android.ModuleContext) android.Path {
+ buildType := func() string {
+ if ctx.Config().Debuggable() {
+ return "userdebug"
+ } else if ctx.Config().Eng() {
+ return "eng"
+ } else {
+ return "user"
+ }
+ }
+ defaultAppCertificate := func() string {
+ pem, _ := ctx.Config().DefaultAppCertificate(ctx)
+ return strings.TrimSuffix(pem.String(), ".x509.pem")
+ }
+
builder := android.NewRuleBuilder(pctx, ctx)
miscInfo := android.PathForModuleOut(ctx, "misc_info.txt")
builder.Command().
Textf("rm -f %s", miscInfo).
Textf("&& echo recovery_api_version=%s >> %s", ctx.Config().VendorConfig("recovery").String("recovery_api_version"), miscInfo).
Textf("&& echo fstab_version=%s >> %s", ctx.Config().VendorConfig("recovery").String("recovery_fstab_version"), miscInfo).
+ Textf("&& echo build_type=%s >> %s", buildType(), miscInfo).
+ Textf("&& echo default_system_dev_certificate=%s >> %s", defaultAppCertificate(), miscInfo).
ImplicitOutput(miscInfo)
if len(ctx.Config().ExtraOtaRecoveryKeys()) > 0 {
builder.Command().Textf(`echo "extra_recovery_keys=%s" >> %s`, strings.Join(ctx.Config().ExtraOtaRecoveryKeys(), ""), miscInfo)
@@ -778,11 +794,17 @@ func (a *androidDevice) addMiscInfo(ctx android.ModuleContext) android.Path {
Textf(" && echo multistage_support=1 >> %s", miscInfo).
Textf(" && echo blockimgdiff_versions=3,4 >> %s", miscInfo)
}
+ fsInfos := a.getFsInfos(ctx)
+ if _, ok := fsInfos["vendor"]; ok {
+ builder.Command().Textf("echo board_uses_vendorimage=true >> %s", miscInfo)
+ }
+ if fsInfos["system"].ErofsCompressHints != nil {
+ builder.Command().Textf("echo erofs_default_compress_hints=%s >> %s", fsInfos["system"].ErofsCompressHints, miscInfo)
+ }
if a.partitionProps.Recovery_partition_name == nil {
builder.Command().Textf("echo no_recovery=true >> %s", miscInfo)
}
- fsInfos := a.getFsInfos(ctx)
for _, partition := range android.SortedKeys(fsInfos) {
if fsInfos[partition].PropFileForMiscInfo != nil {
builder.Command().Text("cat").Input(fsInfos[partition].PropFileForMiscInfo).Textf(" >> %s", miscInfo)