diff options
| -rw-r--r-- | android/variable.go | 4 | ||||
| -rw-r--r-- | filesystem/filesystem.go | 21 | ||||
| -rw-r--r-- | fsgen/filesystem_creator.go | 17 |
3 files changed, 42 insertions, 0 deletions
diff --git a/android/variable.go b/android/variable.go index 4b6182781..969055fc5 100644 --- a/android/variable.go +++ b/android/variable.go @@ -699,6 +699,10 @@ type PartitionVariables struct { PrivateRecoveryUiProperties map[string]string `json:",omitempty"` PrebuiltBootloader string `json:",omitempty"` + + ProductFsCasefold string `json:",omitempty"` + ProductQuotaProjid string `json:",omitempty"` + ProductFsCompression string `json:",omitempty"` } func boolPtr(v bool) *bool { diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index a31516043..38808463e 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -222,6 +222,15 @@ type FilesystemProperties struct { // The size of the partition on the device. It will be a build error if this built partition // image exceeds this size. Partition_size *int64 + + // Whether to format f2fs and ext4 in a way that supports casefolding + Support_casefolding *bool + + // Whether to format f2fs and ext4 in a way that supports project quotas + Support_project_quota *bool + + // Whether to enable per-file compression in f2fs + Enable_compression *bool } type AndroidFilesystemDeps struct { @@ -821,6 +830,18 @@ func (f *filesystem) buildPropFile(ctx android.ModuleContext) (android.Path, and addStr("partition_size", strconv.FormatInt(*f.properties.Partition_size, 10)) } + if proptools.BoolDefault(f.properties.Support_casefolding, false) { + addStr("needs_casefold", "1") + } + + if proptools.BoolDefault(f.properties.Support_project_quota, false) { + addStr("needs_projid", "1") + } + + if proptools.BoolDefault(f.properties.Enable_compression, false) { + addStr("needs_compress", "1") + } + propFilePreProcessing := android.PathForModuleOut(ctx, "prop_pre_processing") android.WriteFileRuleVerbatim(ctx, propFilePreProcessing, propFileString.String()) propFile := android.PathForModuleOut(ctx, "prop") diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go index 8dfbd6499..a4c008dc2 100644 --- a/fsgen/filesystem_creator.go +++ b/fsgen/filesystem_creator.go @@ -382,6 +382,23 @@ func partitionSpecificFsProps(ctx android.EarlyModuleContext, fsProps *filesyste } fsProps.Partition_size = &parsed } + // https://cs.android.com/android/platform/superproject/main/+/main:build/make/core/Makefile;l=2265;drc=7f50a123045520f2c5e18e9eb4e83f92244a1459 + if s, err := strconv.ParseBool(partitionVars.ProductFsCasefold); err == nil { + fsProps.Support_casefolding = proptools.BoolPtr(s) + } else if len(partitionVars.ProductFsCasefold) > 0 { + ctx.ModuleErrorf("Unrecognized PRODUCT_FS_CASEFOLD value %s", partitionVars.ProductFsCasefold) + } + if s, err := strconv.ParseBool(partitionVars.ProductQuotaProjid); err == nil { + fsProps.Support_project_quota = proptools.BoolPtr(s) + } else if len(partitionVars.ProductQuotaProjid) > 0 { + ctx.ModuleErrorf("Unrecognized PRODUCT_QUOTA_PROJID value %s", partitionVars.ProductQuotaProjid) + } + if s, err := strconv.ParseBool(partitionVars.ProductFsCompression); err == nil { + fsProps.Enable_compression = proptools.BoolPtr(s) + } else if len(partitionVars.ProductFsCompression) > 0 { + ctx.ModuleErrorf("Unrecognized PRODUCT_FS_COMPRESSION value %s", partitionVars.ProductFsCompression) + } + case "ramdisk": // Following the logic in https://cs.android.com/android/platform/superproject/main/+/c3c5063df32748a8806ce5da5dd0db158eab9ad9:build/make/core/Makefile;l=1307 fsProps.Dirs = android.NewSimpleConfigurable([]string{ |