Add ramdisk image.
It is similar to recovery image.
Test: m nothing -j
Change-Id: I11389777c6bfb0c0d73bbb4c70091c1e70f44077
diff --git a/android/image.go b/android/image.go
index 5291ce3..061bfa5 100644
--- a/android/image.go
+++ b/android/image.go
@@ -22,6 +22,10 @@
// CoreVariantNeeded should return true if the module needs a core variant (installed on the system image).
CoreVariantNeeded(ctx BaseModuleContext) bool
+ // RamdiskVariantNeeded should return true if the module needs a ramdisk variant (installed on the
+ // ramdisk partition).
+ RamdiskVariantNeeded(ctx BaseModuleContext) bool
+
// RecoveryVariantNeeded should return true if the module needs a recovery variant (installed on the
// recovery partition).
RecoveryVariantNeeded(ctx BaseModuleContext) bool
@@ -46,6 +50,9 @@
// RecoveryVariation means a module to be installed to recovery image.
RecoveryVariation string = "recovery"
+
+ // RamdiskVariation means a module to be installed to ramdisk image.
+ RamdiskVariation string = "ramdisk"
)
// imageMutator creates variants for modules that implement the ImageInterface that
@@ -63,6 +70,9 @@
if m.CoreVariantNeeded(ctx) {
variations = append(variations, CoreVariation)
}
+ if m.RamdiskVariantNeeded(ctx) {
+ variations = append(variations, RamdiskVariation)
+ }
if m.RecoveryVariantNeeded(ctx) {
variations = append(variations, RecoveryVariation)
}