diff options
author | 2021-04-08 21:13:22 +0900 | |
---|---|---|
committer | 2021-04-15 00:56:30 +0000 | |
commit | f84e9c05e2103149162e4a78a68f20c164fbbba2 (patch) | |
tree | dc16f788df5498240fbe3610a124bb5eafdf6422 /android/paths.go | |
parent | d9580b84a2207a9cb552bd4595464459d9a60ba2 (diff) |
Add debug ramdisk variant
A module will be installed to debug_ramdisk (or
debug_ramdisk/first_stage_ramdisk if recovery as boot is true) if
debug_ramdisk is set to true.
Bug: 184004542
Test: soong test
Change-Id: Ic5a4d27407e506fffa462de2149e0785f11b2ac7
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 df1222870..9d4b6eca3 100644 --- a/android/paths.go +++ b/android/paths.go @@ -107,6 +107,7 @@ type ModuleInstallPathContext interface { InstallInSanitizerDir() bool InstallInRamdisk() bool InstallInVendorRamdisk() bool + InstallInDebugRamdisk() bool InstallInRecovery() bool InstallInRoot() bool InstallBypassMake() bool @@ -1849,6 +1850,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" @@ -2019,6 +2030,7 @@ type testModuleInstallPathContext struct { inSanitizerDir bool inRamdisk bool inVendorRamdisk bool + inDebugRamdisk bool inRecovery bool inRoot bool forceOS *OsType @@ -2051,6 +2063,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 } |