From be46a54589bc4b266e9fd59129af7c8fadcc72d0 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Thu, 30 Jul 2015 14:34:01 -0700 Subject: [PATCH] build: Fix "adb shell" in recovery for system_root_image. For system images that contain the root directory, "adb shell" in recovery stops working if the image is mounted at "/system", because sh now locates at /system/system/bin/sh. We fix the issue by mounting the image on /system_root and create a symlink to /system_root/system for /system. Bug: 22855115 Change-Id: Ia6b257b75aeb67687c3909063d1725a23a5ccd60 --- core/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/Makefile b/core/Makefile index e0aa9c37e..0ffb542dc 100644 --- a/core/Makefile +++ b/core/Makefile @@ -863,6 +863,10 @@ define build-recoveryimage-target $(hide) cp $(RECOVERY_INSTALL_OTA_KEYS) $(TARGET_RECOVERY_ROOT_OUT)/res/keys $(hide) cat $(INSTALLED_DEFAULT_PROP_TARGET) $(recovery_build_prop) \ > $(TARGET_RECOVERY_ROOT_OUT)/default.prop + $(if $(filter true,$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)), \ + $(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/system_root; \ + rm -rf $(TARGET_RECOVERY_ROOT_OUT)/system; \ + ln -sf /system_root/system $(TARGET_RECOVERY_ROOT_OUT)/system) # Mount the system_root_image to /system_root and symlink /system. $(hide) $(MKBOOTFS) $(TARGET_RECOVERY_ROOT_OUT) | $(MINIGZIP) > $(recovery_ramdisk) $(if $(filter true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT)), \ $(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(1).unsigned, \ -- 2.11.0