From d7946d13f0892603bc61018f47b48c444ca96289 Mon Sep 17 00:00:00 2001 From: Petri Gynther Date: Wed, 10 Mar 2021 12:38:15 -0800 Subject: [PATCH 1/2] Add support for building vendor_ramdisk-debug.img Existing BoardConfig.mk variable: BOARD_BUILD_VENDOR_RAMDISK_IMAGE := true generates: out/target/product//vendor_ramdisk.img Extend the above to additionally generate: out/target/product//vendor_ramdisk-debug.img as the two ramdisks should be built together. Test: make Change-Id: Ief572e30c9225d0f5569e9ff89096c69accafc7f --- core/Makefile | 8 +++++++- core/main.mk | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/Makefile b/core/Makefile index a67d02a16..357914200 100644 --- a/core/Makefile +++ b/core/Makefile @@ -2390,13 +2390,19 @@ $(INTERNAL_VENDOR_DEBUG_RAMDISK_TARGET): DEBUG_RAMDISK_DIR := $(PRODUCT_OUT)/deb $(INTERNAL_VENDOR_DEBUG_RAMDISK_TARGET): VENDOR_DEBUG_RAMDISK_DIR := $(PRODUCT_OUT)/vendor_debug_ramdisk $(INTERNAL_VENDOR_DEBUG_RAMDISK_TARGET): $(INTERNAL_VENDOR_RAMDISK_TARGET) $(INSTALLED_DEBUG_RAMDISK_TARGET) $(INTERNAL_VENDOR_DEBUG_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_VENDOR_DEBUG_RAMDISK_FILES) | $(COMPRESSION_COMMAND_DEPS) - $(call pretty,"Target vendor debug ramdisk: $@") mkdir -p $(TARGET_VENDOR_DEBUG_RAMDISK_OUT) touch $(TARGET_VENDOR_DEBUG_RAMDISK_OUT)/force_debuggable $(foreach debug_file,$(DEBUG_RAMDISK_FILES), \ cp -f $(debug_file) $(patsubst $(DEBUG_RAMDISK_DIR)/%,$(VENDOR_DEBUG_RAMDISK_DIR)/%,$(debug_file)) &&) true $(MKBOOTFS) -d $(TARGET_OUT) $(VENDOR_RAMDISK_DIR) $(VENDOR_DEBUG_RAMDISK_DIR) $(PRIVATE_ADDITIONAL_DIR) | $(COMPRESSION_COMMAND) > $@ +ifeq (true,$(BOARD_BUILD_VENDOR_RAMDISK_IMAGE)) +INSTALLED_VENDOR_DEBUG_RAMDISK_TARGET := $(PRODUCT_OUT)/vendor_ramdisk-debug.img +$(INSTALLED_VENDOR_DEBUG_RAMDISK_TARGET): $(INTERNAL_VENDOR_DEBUG_RAMDISK_TARGET) + $(call pretty,"Target vendor debug ramdisk: $@") + $(copy-file-to-target) +endif + INSTALLED_FILES_FILE_VENDOR_DEBUG_RAMDISK := $(PRODUCT_OUT)/installed-files-vendor-ramdisk-debug.txt INSTALLED_FILES_JSON_VENDOR_DEBUG_RAMDISK := $(INSTALLED_FILES_FILE_VENDOR_DEBUG_RAMDISK:.txt=.json) $(INSTALLED_FILES_FILE_VENDOR_DEBUG_RAMDISK): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_VENDOR_DEBUG_RAMDISK) diff --git a/core/main.mk b/core/main.mk index 97ed93d5d..d84e43e84 100644 --- a/core/main.mk +++ b/core/main.mk @@ -1497,6 +1497,9 @@ vendorbootimage_debug: $(INSTALLED_VENDOR_DEBUG_BOOTIMAGE_TARGET) .PHONY: vendorramdisk vendorramdisk: $(INSTALLED_VENDOR_RAMDISK_TARGET) +.PHONY: vendorramdisk_debug +vendorramdisk_debug: $(INSTALLED_VENDOR_DEBUG_RAMDISK_TARGET) + .PHONY: productimage productimage: $(INSTALLED_PRODUCTIMAGE_TARGET) @@ -1556,6 +1559,7 @@ droidcore: $(filter $(HOST_OUT_ROOT)/%,$(modules_to_install)) \ $(INSTALLED_VENDOR_BOOTIMAGE_TARGET) \ $(INSTALLED_VENDOR_DEBUG_BOOTIMAGE_TARGET) \ $(INSTALLED_VENDOR_RAMDISK_TARGET) \ + $(INSTALLED_VENDOR_DEBUG_RAMDISK_TARGET) \ $(INSTALLED_ODMIMAGE_TARGET) \ $(INSTALLED_VENDOR_DLKMIMAGE_TARGET) \ $(INSTALLED_ODM_DLKMIMAGE_TARGET) \ From 1426cab4684bbd93881877667081c53745006b68 Mon Sep 17 00:00:00 2001 From: Petri Gynther Date: Wed, 10 Mar 2021 12:51:55 -0800 Subject: [PATCH 2/2] Copy vendor_ramdisk[-debug].img to out/dist Test: make Change-Id: Ibac6424f600b77d222585c17a91d59fb6985df26 --- core/main.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/main.mk b/core/main.mk index d84e43e84..63fac4373 100644 --- a/core/main.mk +++ b/core/main.mk @@ -1744,6 +1744,8 @@ else ifeq (,$(TARGET_BUILD_UNBUNDLED)) $(INSTALLED_DEBUG_RAMDISK_TARGET) \ $(INSTALLED_DEBUG_BOOTIMAGE_TARGET) \ $(INSTALLED_VENDOR_DEBUG_BOOTIMAGE_TARGET) \ + $(INSTALLED_VENDOR_RAMDISK_TARGET) \ + $(INSTALLED_VENDOR_DEBUG_RAMDISK_TARGET) \ ) $(call dist-for-goals, bootimage_test_harness, \ $(INSTALLED_TEST_HARNESS_RAMDISK_TARGET) \