Add InstallInRoot to allow modules to install into root partition

If InstallInRoot() returns true the module will be installed to
$OUT/root or $OUT/recovery/root.

Bug: 141877526
Test: m checkbuild
Test: no change to build.ninja or Android-${TARGET_PRODUCT}.mk
Test: TestPathForModuleInstall
Change-Id: Id6e435c6019f11eeb5806528fd464dbf220b88d9
This commit is contained in:
Colin Cross
2019-10-02 11:10:58 -07:00
parent 62be1e3e33
commit 90ba5f4e98
3 changed files with 58 additions and 2 deletions

View File

@@ -47,6 +47,7 @@ type ModuleInstallPathContext interface {
InstallInTestcases() bool
InstallInSanitizerDir() bool
InstallInRecovery() bool
InstallInRoot() bool
InstallBypassMake() bool
}
@@ -1159,8 +1160,12 @@ func modulePartition(ctx ModuleInstallPathContext) string {
} else if ctx.InstallInTestcases() {
partition = "testcases"
} else if ctx.InstallInRecovery() {
// the layout of recovery partion is the same as that of system partition
partition = "recovery/root/system"
if ctx.InstallInRoot() {
partition = "recovery/root"
} else {
// the layout of recovery partion is the same as that of system partition
partition = "recovery/root/system"
}
} else if ctx.SocSpecific() {
partition = ctx.DeviceConfig().VendorPath()
} else if ctx.DeviceSpecific() {
@@ -1169,6 +1174,8 @@ func modulePartition(ctx ModuleInstallPathContext) string {
partition = ctx.DeviceConfig().ProductPath()
} else if ctx.SystemExtSpecific() {
partition = ctx.DeviceConfig().SystemExtPath()
} else if ctx.InstallInRoot() {
partition = "root"
} else {
partition = "system"
}