From 9a1756862445f4014f6983cf09992a99d2a7377c Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Thu, 6 Aug 2015 11:47:47 -0700 Subject: [PATCH] Allow custom recovery resource dirs. Set TARGET_PRIVATE_RES_DIRS in your BoardConfig.mk to specify custom private recovery resource directories. With this change you can share the same recovery resource dir for more than one device; Also you can specify more than one directories. Change-Id: Ieeb18f5ac11c98b6f08d0ab6fb4e0d9aa72b27e7 --- core/Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/Makefile b/core/Makefile index f7f6e4850..c3b888bfc 100644 --- a/core/Makefile +++ b/core/Makefile @@ -779,9 +779,11 @@ else recovery_font := $(call include-path-for, recovery)/fonts/12x22.png endif -recovery_resources_private := $(strip $(wildcard $(TARGET_DEVICE_DIR)/recovery/res)) +ifndef TARGET_PRIVATE_RES_DIRS +TARGET_PRIVATE_RES_DIRS := $(wildcard $(TARGET_DEVICE_DIR)/recovery/res) +endif recovery_resource_deps := $(shell find $(recovery_resources_common) \ - $(recovery_resources_private) -type f) + $(TARGET_PRIVATE_RES_DIRS) -type f) ifdef TARGET_RECOVERY_FSTAB recovery_fstab := $(TARGET_RECOVERY_FSTAB) else @@ -797,7 +799,7 @@ else RECOVERY_RESOURCE_ZIP := endif -ifeq ($(recovery_resources_private),) +ifeq ($(TARGET_PRIVATE_RES_DIRS),) $(info No private recovery resources for TARGET_DEVICE $(TARGET_DEVICE)) endif @@ -857,8 +859,8 @@ define build-recoveryimage-target $(hide) rm -rf $(TARGET_RECOVERY_ROOT_OUT)/res/* $(hide) cp -rf $(recovery_resources_common)/* $(TARGET_RECOVERY_ROOT_OUT)/res $(hide) cp -f $(recovery_font) $(TARGET_RECOVERY_ROOT_OUT)/res/images/font.png - $(hide) $(foreach item,$(recovery_resources_private), \ - cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/) + $(hide) $(foreach item,$(TARGET_PRIVATE_RES_DIRS), \ + cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/$(newline)) $(hide) $(foreach item,$(recovery_fstab), \ cp -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/etc/recovery.fstab) $(hide) cp $(RECOVERY_INSTALL_OTA_KEYS) $(TARGET_RECOVERY_ROOT_OUT)/res/keys