diff --git a/android/config.go b/android/config.go index cf6d596f4..004b74378 100644 --- a/android/config.go +++ b/android/config.go @@ -1312,6 +1312,10 @@ func (c *deviceConfig) BoardKernelModuleInterfaceVersions() []string { return c.config.productVariables.BoardKernelModuleInterfaceVersions } +func (c *deviceConfig) BoardMoveRecoveryResourcesToVendorBoot() bool { + return Bool(c.config.productVariables.BoardMoveRecoveryResourcesToVendorBoot) +} + // The ConfiguredJarList struct provides methods for handling a list of (apex, jar) pairs. // Such lists are used in the build system for things like bootclasspath jars or system server jars. // The apex part is either an apex name, or a special names "platform" or "system_ext". Jar is a diff --git a/android/paths.go b/android/paths.go index 8fd2e88d9..4eb9d2030 100644 --- a/android/paths.go +++ b/android/paths.go @@ -1378,8 +1378,14 @@ func modulePartition(ctx ModuleInstallPathContext, os OsType) string { partition += "/system" } } else if ctx.InstallInVendorRamdisk() { - // TODO(elsk): Should be conditional on move_recovery_res_to_vendor_boot - partition = "vendor-ramdisk" + if ctx.DeviceConfig().BoardMoveRecoveryResourcesToVendorBoot() { + partition = "recovery/root/first_stage_ramdisk" + } else { + partition = "vendor-ramdisk" + } + if !ctx.InstallInRoot() { + partition += "/system" + } } else if ctx.InstallInRecovery() { if ctx.InstallInRoot() { partition = "recovery/root" diff --git a/android/variable.go b/android/variable.go index 73062ed64..23fc6c209 100644 --- a/android/variable.go +++ b/android/variable.go @@ -352,6 +352,8 @@ type productVariables struct { BoardKernelBinaries []string `json:",omitempty"` BoardKernelModuleInterfaceVersions []string `json:",omitempty"` + + BoardMoveRecoveryResourcesToVendorBoot *bool `json:",omitempty"` } func boolPtr(v bool) *bool {