From 9a05dca429f1007b31fdf6a5542c94ab07395d5c Mon Sep 17 00:00:00 2001 From: Bowgo Tsai Date: Fri, 28 Jul 2017 20:22:05 +0800 Subject: [PATCH] Copy adbd from system/bin to recovery/root/sbin This change will be submitted with other changes moving adbd from root/sbin to system/bin. We need to copy it specifically to recovery root. Previously it was copied by rsync $(TARGET_ROOT_OUT) $(TARGET_RECOVERY_OUT). Bug: 63910933 Test: normal boot sailfish, checks adb works Test: recovery boot sailfish, checks adb works Test: normal boot bullhead, checks adb works Test: recovery boot bullhead, checks adb works Change-Id: Ib49605f97a190aec2648cb000d1159b6e15db673 Merged-In: Ib49605f97a190aec2648cb000d1159b6e15db673 (cherry picked from commit 3147e7cfab919c90d322d5cdcd6bd2730d104b38) --- CleanSpec.mk | 4 ++++ core/Makefile | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CleanSpec.mk b/CleanSpec.mk index 6a3e53e39..63d6f666c 100644 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -428,6 +428,10 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/nativetest*) $(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/*/*/classes*.jack) $(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/*/*/jack*) +# Move adbd from $(PRODUCT_OUT)/root/sbin to $(PRODUCT_OUT)/system/bin +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/sbin/adbd) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/symbols/sbin/adbd) + # ************************************************ # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST # ************************************************ diff --git a/core/Makefile b/core/Makefile index e0d02340e..eeb724031 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1186,6 +1186,8 @@ define build-recoveryimage-target @echo Copying baseline ramdisk... # Use rsync because "cp -Rf" fails to overwrite broken symlinks on Mac. $(hide) rsync -a --exclude=etc --exclude=sdcard $(IGNORE_RECOVERY_SEPOLICY) $(IGNORE_CACHE_LINK) $(TARGET_ROOT_OUT) $(TARGET_RECOVERY_OUT) + # Copy adbd from system/bin to recovery/root/sbin + $(hide) cp -f $(TARGET_OUT_EXECUTABLES)/adbd $(TARGET_RECOVERY_ROOT_OUT)/sbin/adbd @echo Modifying ramdisk contents... $(if $(BOARD_RECOVERY_KERNEL_MODULES), \ $(call build-image-kernel-modules,$(BOARD_RECOVERY_KERNEL_MODULES),$(TARGET_RECOVERY_ROOT_OUT),,$(call intermediates-dir-for,PACKAGING,depmod_recovery))) @@ -1239,6 +1241,8 @@ define build-recoveryimage-target @echo ----- Made recovery image: $(1) -------- endef +ADBD := $(TARGET_OUT_EXECUTABLES)/adbd + ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) ifeq (true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_BOOT_SIGNER)) $(INSTALLED_BOOTIMAGE_TARGET) : $(BOOT_SIGNER) @@ -1249,7 +1253,7 @@ endif ifeq (true,$(BOARD_AVB_ENABLE)) $(INSTALLED_BOOTIMAGE_TARGET) : $(AVBTOOL) $(BOARD_AVB_BOOT_KEY_PATH) endif -$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \ +$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) $(ADBD) \ $(INSTALLED_RAMDISK_TARGET) \ $(INTERNAL_RECOVERYIMAGE_FILES) \ $(recovery_initrc) $(recovery_sepolicy) $(recovery_kernel) \ @@ -1264,7 +1268,7 @@ $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \ $(call build-recoveryimage-target, $@) endif -$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \ +$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) $(ADBD) \ $(INSTALLED_RAMDISK_TARGET) \ $(INSTALLED_BOOTIMAGE_TARGET) \ $(INTERNAL_RECOVERYIMAGE_FILES) \