diff options
Diffstat (limited to 'android/paths.go')
| -rw-r--r-- | android/paths.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/android/paths.go b/android/paths.go index 93c5684f3..026cb8747 100644 --- a/android/paths.go +++ b/android/paths.go @@ -106,6 +106,7 @@ type ModuleInstallPathContext interface { InstallInSanitizerDir() bool InstallInRamdisk() bool InstallInVendorRamdisk() bool + InstallInDebugRamdisk() bool InstallInRecovery() bool InstallInRoot() bool InstallBypassMake() bool @@ -1689,6 +1690,16 @@ func modulePartition(ctx ModuleInstallPathContext, os OsType) string { if !ctx.InstallInRoot() { partition += "/system" } + } else if ctx.InstallInDebugRamdisk() { + // The module is only available after switching root into + // /first_stage_ramdisk. To expose the module before switching root + // on a device without a dedicated recovery partition, install the + // recovery variant. + if ctx.DeviceConfig().BoardUsesRecoveryAsBoot() { + partition = "debug_ramdisk/first_stage_ramdisk" + } else { + partition = "debug_ramdisk" + } } else if ctx.InstallInRecovery() { if ctx.InstallInRoot() { partition = "recovery/root" @@ -1859,6 +1870,7 @@ type testModuleInstallPathContext struct { inSanitizerDir bool inRamdisk bool inVendorRamdisk bool + inDebugRamdisk bool inRecovery bool inRoot bool forceOS *OsType @@ -1891,6 +1903,10 @@ func (m testModuleInstallPathContext) InstallInVendorRamdisk() bool { return m.inVendorRamdisk } +func (m testModuleInstallPathContext) InstallInDebugRamdisk() bool { + return m.inDebugRamdisk +} + func (m testModuleInstallPathContext) InstallInRecovery() bool { return m.inRecovery } |