From 62eacaeb4ebf5e9b60590a3cb1a3b90533aadd96 Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Tue, 18 Mar 2025 20:37:42 +0000 Subject: Add vintf info and userdata size to Soong's misc_info.txt - vintf info will be read from the global productVariables struct. This will likely need to be revisited when we have multiple android_device's in the tree - userdata has been special-cased to create a `userdata_size` entry in addition to $(filesystem)_partition_size entry. This special case matches the make misc_info.txt implementation. Bug: 398036609 Test: Built Soong's misc_info.txt locally Change-Id: I9f312c8022c5faf84442cb51f1e13043768aed53 --- filesystem/android_device.go | 8 ++++++++ filesystem/filesystem.go | 4 ++++ 2 files changed, 12 insertions(+) (limited to 'filesystem') diff --git a/filesystem/android_device.go b/filesystem/android_device.go index cb54f783e..443e80e67 100644 --- a/filesystem/android_device.go +++ b/filesystem/android_device.go @@ -819,6 +819,14 @@ func (a *androidDevice) addMiscInfo(ctx android.ModuleContext) android.Path { // TODO: Add support for TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS which can be used to override the default builder.Command().Textf("echo recovery_mount_options=%s >> %s", defaultTargetRecoveryFstypeMountOptions, miscInfo) + // vintf information + if proptools.Bool(ctx.Config().ProductVariables().Enforce_vintf_manifest) { + builder.Command().Textf("echo vintf_enforce=true >> %s", miscInfo) + } + if len(ctx.Config().DeviceManifestFiles()) > 0 { + builder.Command().Textf("echo vintf_include_empty_vendor_sku=true >> %s", miscInfo) + } + if a.partitionProps.Recovery_partition_name == nil { builder.Command().Textf("echo no_recovery=true >> %s", miscInfo) } diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index 3d8477d62..af14e811a 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -1175,6 +1175,10 @@ func (f *filesystem) buildPropFileForMiscInfo(ctx android.ModuleContext) android // effect as _disable_sparse. if f.properties.Partition_size == nil { addStr(f.partitionName()+"_disable_sparse", "true") + } else if f.partitionName() == "userdata" { + // Add userdata's partition size to misc_info.txt. + // userdata has been special-cased to make the make packaging misc_info.txt implementation + addStr("userdata_size", strconv.FormatInt(*f.properties.Partition_size, 10)) } fst := f.fsType(ctx) -- cgit v1.2.3-59-g8ed1b