From 1605938e8c1facfcbf2826f4fd99eca128c3c2b6 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Wed, 14 Oct 2020 15:17:20 -0600 Subject: [PATCH] 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 --- core/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/Makefile b/core/Makefile index d630a6a6c0..2d7144a98f 100644 --- a/core/Makefile +++ b/core/Makefile @@ -4395,6 +4395,7 @@ $(BUILT_TARGET_FILES_PACKAGE): \ $(INSTALLED_CUSTOMIMAGES_TARGET) \ $(INSTALLED_ANDROID_INFO_TXT_TARGET) \ $(INSTALLED_KERNEL_TARGET) \ + $(INSTALLED_RAMDISK_TARGET) \ $(INSTALLED_DTBIMAGE_TARGET) \ $(INSTALLED_2NDBOOTLOADER_TARGET) \ $(BOARD_PREBUILT_DTBOIMAGE) \ @@ -4562,6 +4563,13 @@ endif @# 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