diff options
Diffstat (limited to 'filesystem/filesystem.go')
-rw-r--r-- | filesystem/filesystem.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index 993c46e49..a31516043 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -218,6 +218,10 @@ type FilesystemProperties struct { // Name of the output. Default is $(module_name).img Stem *string + + // 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 } type AndroidFilesystemDeps struct { @@ -672,6 +676,10 @@ func (f *filesystem) buildImageUsingBuildImage(ctx android.ModuleContext) (andro copyImageFileToProductOut(ctx, builder, f.partitionName(), output) } + if f.properties.Partition_size != nil { + assertMaxImageSize(builder, output, *f.properties.Partition_size, false) + } + // rootDir is not deleted. Might be useful for quick inspection. builder.Build("build_filesystem_image", fmt.Sprintf("Creating filesystem %s", f.BaseModuleName())) @@ -809,6 +817,10 @@ func (f *filesystem) buildPropFile(ctx android.ModuleContext) (android.Path, and } f.checkFsTypePropertyError(ctx, fst, fsTypeStr(fst)) + if f.properties.Partition_size != nil { + addStr("partition_size", strconv.FormatInt(*f.properties.Partition_size, 10)) + } + propFilePreProcessing := android.PathForModuleOut(ctx, "prop_pre_processing") android.WriteFileRuleVerbatim(ctx, propFilePreProcessing, propFileString.String()) propFile := android.PathForModuleOut(ctx, "prop") |