Ramdisk modules install to correct location

am: 82db735fbc

Change-Id: I36abb4def08d4b1ce463ad18e1d0ff4099985d8a
This commit is contained in:
Yifan Hong
2020-01-24 16:33:17 -08:00
committed by android-build-merger
3 changed files with 14 additions and 2 deletions

View File

@@ -1237,3 +1237,7 @@ func (c *deviceConfig) DeviceSecondaryArch() string {
func (c *deviceConfig) DeviceSecondaryArchVariant() string { func (c *deviceConfig) DeviceSecondaryArchVariant() string {
return String(c.config.productVariables.DeviceSecondaryArchVariant) return String(c.config.productVariables.DeviceSecondaryArchVariant)
} }
func (c *deviceConfig) BoardUsesRecoveryAsBoot() bool {
return Bool(c.config.productVariables.BoardUsesRecoveryAsBoot)
}

View File

@@ -1256,8 +1256,14 @@ func modulePartition(ctx ModuleInstallPathContext) string {
} else if ctx.InstallInTestcases() { } else if ctx.InstallInTestcases() {
partition = "testcases" partition = "testcases"
} else if ctx.InstallInRamdisk() { } else if ctx.InstallInRamdisk() {
// TODO(elsk): should be conditional on RECOVERY_AS_BOOT if ctx.DeviceConfig().BoardUsesRecoveryAsBoot() {
partition = "recovery/root/first_stage_ramdisk"
} else {
partition = "ramdisk" partition = "ramdisk"
}
if !ctx.InstallInRoot() {
partition += "/system"
}
} else if ctx.InstallInRecovery() { } else if ctx.InstallInRecovery() {
if ctx.InstallInRoot() { if ctx.InstallInRoot() {
partition = "recovery/root" partition = "recovery/root"

View File

@@ -317,6 +317,8 @@ type productVariables struct {
EnforceProductPartitionInterface *bool `json:",omitempty"` EnforceProductPartitionInterface *bool `json:",omitempty"`
InstallExtraFlattenedApexes *bool `json:",omitempty"` InstallExtraFlattenedApexes *bool `json:",omitempty"`
BoardUsesRecoveryAsBoot *bool `json:",omitempty"`
} }
func boolPtr(v bool) *bool { func boolPtr(v bool) *bool {