diff options
author | Inseob Kim <inseob@google.com> | 2021-03-31 16:28:35 +0900 |
---|---|---|
committer | Inseob Kim <inseob@google.com> | 2021-04-01 13:19:30 +0900 |
commit | a46b51cf207bbfe6f89e1b355988b6871f16792a (patch) | |
tree | 24992f4937d307bfc7153cbb639d4a8ac9b14468 /filesystem/logical_partition.go | |
parent | ce08a57bb1410bedb289d27ad2f8a865029766fb (diff) |
Support super image size automatic calculation
If the size is set to "auto", the size will be automatically calculated
by lpmake.
Bug: 181107248
Test: boot microdroid
Change-Id: I9dd599ca64e4d442bfb83fe45b1f03080a74f1e1
Diffstat (limited to 'filesystem/logical_partition.go')
-rw-r--r-- | filesystem/logical_partition.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/filesystem/logical_partition.go b/filesystem/logical_partition.go index dbbc1d88a..739e609ed 100644 --- a/filesystem/logical_partition.go +++ b/filesystem/logical_partition.go @@ -40,7 +40,8 @@ type logicalPartitionProperties struct { // Set the name of the output. Defaults to <module_name>.img. Stem *string - // Total size of the logical partition + // Total size of the logical partition. If set to "auto", total size is automatically + // calcaulted as minimum. Size *string // List of partitions for default group. Default group has no size limit and automatically @@ -117,9 +118,8 @@ func (l *logicalPartition) GenerateAndroidBuildActions(ctx android.ModuleContext size := proptools.String(l.properties.Size) if size == "" { ctx.PropertyErrorf("size", "must be set") - } - if _, err := strconv.Atoi(size); err != nil { - ctx.PropertyErrorf("size", "must be a number") + } else if _, err := strconv.Atoi(size); err != nil && size != "auto" { + ctx.PropertyErrorf("size", `must be a number or "auto"`) } cmd.FlagWithArg("--device-size=", size) |