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
This commit is contained in:
parent
ce08a57bb1
commit
a46b51cf20
|
@ -40,7 +40,8 @@ type logicalPartitionProperties struct {
|
||||||
// Set the name of the output. Defaults to <module_name>.img.
|
// Set the name of the output. Defaults to <module_name>.img.
|
||||||
Stem *string
|
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
|
Size *string
|
||||||
|
|
||||||
// List of partitions for default group. Default group has no size limit and automatically
|
// 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)
|
size := proptools.String(l.properties.Size)
|
||||||
if size == "" {
|
if size == "" {
|
||||||
ctx.PropertyErrorf("size", "must be set")
|
ctx.PropertyErrorf("size", "must be set")
|
||||||
}
|
} else if _, err := strconv.Atoi(size); err != nil && size != "auto" {
|
||||||
if _, err := strconv.Atoi(size); err != nil {
|
ctx.PropertyErrorf("size", `must be a number or "auto"`)
|
||||||
ctx.PropertyErrorf("size", "must be a number")
|
|
||||||
}
|
}
|
||||||
cmd.FlagWithArg("--device-size=", size)
|
cmd.FlagWithArg("--device-size=", size)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue