Add vendor-ramdisk image to Soong.
Add vendor_ramdisk_available and vendor_ramdisk attribute to
various rules. When a vendor_ramdisk variant of a module is
generated, it is installed to $OUT/vendor-ramdisk.
It is similar to a ramdisk image.
Test: m nothing -j
Change-Id: Ib2d16459f3094dbe21c3bdb7c016cb4b2bf62765
diff --git a/android/image.go b/android/image.go
index 061bfa5..1a1a423 100644
--- a/android/image.go
+++ b/android/image.go
@@ -26,6 +26,10 @@
// ramdisk partition).
RamdiskVariantNeeded(ctx BaseModuleContext) bool
+ // VendorRamdiskVariantNeeded should return true if the module needs a vendor ramdisk variant (installed on the
+ // vendor ramdisk partition).
+ VendorRamdiskVariantNeeded(ctx BaseModuleContext) bool
+
// RecoveryVariantNeeded should return true if the module needs a recovery variant (installed on the
// recovery partition).
RecoveryVariantNeeded(ctx BaseModuleContext) bool
@@ -53,6 +57,9 @@
// RamdiskVariation means a module to be installed to ramdisk image.
RamdiskVariation string = "ramdisk"
+
+ // VendorRamdiskVariation means a module to be installed to vendor ramdisk image.
+ VendorRamdiskVariation string = "vendor_ramdisk"
)
// imageMutator creates variants for modules that implement the ImageInterface that
@@ -73,6 +80,9 @@
if m.RamdiskVariantNeeded(ctx) {
variations = append(variations, RamdiskVariation)
}
+ if m.VendorRamdiskVariantNeeded(ctx) {
+ variations = append(variations, VendorRamdiskVariation)
+ }
if m.RecoveryVariantNeeded(ctx) {
variations = append(variations, RecoveryVariation)
}