Support recovery and recovery_available
`recovery: true` installs a module to the recovery partition.
`recovery_available: true` makes a module to be available to other
`recovery:true` or `recovery_available: true` modules.
These to are very similar to vendor, vendor_available properties, except
for the target partition.
Bug: 67916654
Bug: 64960723
Test: m -j, toybox_recovery is installed to the recovery/root/sbin
Change-Id: Iaebe0593de16c69fa70de251a61f4d018a251509
diff --git a/android/module.go b/android/module.go
index fba1917..3316a44 100644
--- a/android/module.go
+++ b/android/module.go
@@ -124,6 +124,7 @@
InstallInData() bool
InstallInSanitizerDir() bool
+ InstallInRecovery() bool
RequiredModuleNames() []string
@@ -176,6 +177,7 @@
Target() Target
InstallInData() bool
InstallInSanitizerDir() bool
+ InstallInRecovery() bool
SkipInstall()
ExportedToMake() bool
@@ -237,6 +239,9 @@
// /system/product if product partition does not exist).
Product_specific *bool
+ // Whether this module is installed to recovery partition
+ Recovery *bool
+
// init.rc files to be installed if this module is installed
Init_rc []string
@@ -560,6 +565,10 @@
return false
}
+func (p *ModuleBase) InstallInRecovery() bool {
+ return Bool(p.commonProperties.Recovery)
+}
+
func (a *ModuleBase) generateModuleTarget(ctx ModuleContext) {
allInstalledFiles := Paths{}
allCheckbuildFiles := Paths{}
@@ -1008,6 +1017,10 @@
return a.module.InstallInSanitizerDir()
}
+func (a *androidModuleContext) InstallInRecovery() bool {
+ return a.module.InstallInRecovery()
+}
+
func (a *androidModuleContext) skipInstall(fullInstallPath OutputPath) bool {
if a.module.base().commonProperties.SkipInstall {
return true