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
Merged-In: Id29408551cd41c11b96157248e238324a327043d
This commit is contained in:
Enrico Granata 2020-10-14 15:17:20 -06:00
parent bea507259c
commit 1605938e8c
1 changed files with 8 additions and 0 deletions

View File

@ -4395,6 +4395,7 @@ $(BUILT_TARGET_FILES_PACKAGE): \
$(INSTALLED_CUSTOMIMAGES_TARGET) \ $(INSTALLED_CUSTOMIMAGES_TARGET) \
$(INSTALLED_ANDROID_INFO_TXT_TARGET) \ $(INSTALLED_ANDROID_INFO_TXT_TARGET) \
$(INSTALLED_KERNEL_TARGET) \ $(INSTALLED_KERNEL_TARGET) \
$(INSTALLED_RAMDISK_TARGET) \
$(INSTALLED_DTBIMAGE_TARGET) \ $(INSTALLED_DTBIMAGE_TARGET) \
$(INSTALLED_2NDBOOTLOADER_TARGET) \ $(INSTALLED_2NDBOOTLOADER_TARGET) \
$(BOARD_PREBUILT_DTBOIMAGE) \ $(BOARD_PREBUILT_DTBOIMAGE) \
@ -4562,6 +4563,13 @@ endif
@# Extra contents of the OTA package @# Extra contents of the OTA package
$(hide) mkdir -p $(zip_root)/OTA $(hide) mkdir -p $(zip_root)/OTA
$(hide) cp $(INSTALLED_ANDROID_INFO_TXT_TARGET) $(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) ifeq ($(TARGET_OTA_ALLOW_NON_AB),true)
ifneq ($(built_ota_tools),) ifneq ($(built_ota_tools),)
$(hide) mkdir -p $(zip_root)/OTA/bin $(hide) mkdir -p $(zip_root)/OTA/bin