Enable uploading ramdisk to target img.zip

For some devices, the img.zip package needs to contain the ramdisk
in order to enable device-specific flashing to work properly

This change adds a new flag BOARD_IMG_USE_RAMDISK to the possible
device Makefile configuration. If set to true, the build process
will insert ramdisk.img in the target-files.zip and img.zip
build outputs of "m dist". No change will occur for builds
that do not use this flag, or set it to a non-true value.

Bug: 168642807
Test: lunch trout_arm64-userdebug, m dist with and w/out
      BOARD_IMG_USE_RAMDISK added to Makefile;
      lunch aosp_cf_arm64-phone-userdebug, m dist
Change-Id: Id29408551cd41c11b96157248e238324a327043d
diff --git a/core/Makefile b/core/Makefile
index 110d898..b525f60 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -4393,6 +4393,7 @@
 	    $(INSTALLED_CUSTOMIMAGES_TARGET) \
 	    $(INSTALLED_ANDROID_INFO_TXT_TARGET) \
 	    $(INSTALLED_KERNEL_TARGET) \
+	    $(INSTALLED_RAMDISK_TARGET) \
 	    $(INSTALLED_DTBIMAGE_TARGET) \
 	    $(INSTALLED_2NDBOOTLOADER_TARGET) \
 	    $(BOARD_PREBUILT_DTBOIMAGE) \
@@ -4560,6 +4561,13 @@
 	@# Extra contents of the OTA package
 	$(hide) mkdir -p $(zip_root)/OTA
 	$(hide) cp $(INSTALLED_ANDROID_INFO_TXT_TARGET) $(zip_root)/OTA/
+ifdef BUILDING_RAMDISK_IMAGE
+ifeq (true,$(BOARD_IMG_USE_RAMDISK))
+	@# Contents of the ramdisk image
+	$(hide) mkdir -p $(zip_root)/IMAGES
+	$(hide) cp $(INSTALLED_RAMDISK_TARGET) $(zip_root)/IMAGES/
+endif
+endif
 ifeq ($(TARGET_OTA_ALLOW_NON_AB),true)
 ifneq ($(built_ota_tools),)
 	$(hide) mkdir -p $(zip_root)/OTA/bin