From f00885f29942ead37633031e9e7a3f095cdcdae2 Mon Sep 17 00:00:00 2001 From: Bowgo Tsai Date: Wed, 24 Apr 2019 15:33:03 +0800 Subject: [PATCH] Fix build error for no-ramdisk targets In some build targets, e.g., aosp_arm64_ab, $OUT/ramdisk is an empty dir, and leads to rsync $OUT/ramdisk/* failure. Removing the trailing asterisk to avoid throwing an error if it's empty. Note that the trailing slash still needs to be kept to avoid creating an additional directory level at the destination. Bug: 126493225 Test: `make ramdisk_debug` on aosp_arm64_ab Test: flash boot-debug.img on crosshatch still can adb root Change-Id: I44937324379fa78fc26a4471ba94eb7694911c2d (cherry picked from commit 85f292939647fb9bd659a6a5deebd3f07dd3a079) --- core/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/Makefile b/core/Makefile index ca040f6ca..5c7cbe169 100644 --- a/core/Makefile +++ b/core/Makefile @@ -2042,7 +2042,7 @@ $(INSTALLED_DEBUG_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_DEBUG_RAMDISK_FILES) | $(call pretty,"Target debug ram disk: $@") mkdir -p $(TARGET_DEBUG_RAMDISK_OUT) touch $(TARGET_DEBUG_RAMDISK_OUT)/force_debuggable - rsync -a $(DEBUG_RAMDISK_SYNC_DIR)/* $(DEBUG_RAMDISK_ROOT_DIR) + rsync -a $(DEBUG_RAMDISK_SYNC_DIR)/ $(DEBUG_RAMDISK_ROOT_DIR) $(MKBOOTFS) -d $(TARGET_OUT) $(DEBUG_RAMDISK_ROOT_DIR) | $(MINIGZIP) > $@ .PHONY: ramdisk_debug-nodeps @@ -2052,7 +2052,7 @@ ramdisk_debug-nodeps: $(MKBOOTFS) | $(MINIGZIP) echo "make $@: ignoring dependencies" mkdir -p $(TARGET_DEBUG_RAMDISK_OUT) touch $(TARGET_DEBUG_RAMDISK_OUT)/force_debuggable - rsync -a $(DEBUG_RAMDISK_SYNC_DIR)/* $(DEBUG_RAMDISK_ROOT_DIR) + rsync -a $(DEBUG_RAMDISK_SYNC_DIR)/ $(DEBUG_RAMDISK_ROOT_DIR) $(MKBOOTFS) -d $(TARGET_OUT) $(DEBUG_RAMDISK_ROOT_DIR) | $(MINIGZIP) > $(INSTALLED_DEBUG_RAMDISK_TARGET) my_debug_ramdisk_sync_dir :=