From 8f90389966fabf532b24741d49245215279533e1 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Thu, 30 Jul 2015 14:43:27 -0700 Subject: recovery: Allow "Mount /system" for system_root_image. When system images contain the root directory, there is no entry of "/system" in the fstab. Change it to look for "/" instead if ro.build.system_root_image is true. We actually mount the partition to /system_root instead, and create a symlink to /system_root/system for /system. This allows "adb shell" to work properly. Bug: 22855115 Change-Id: I91864444950dc3229fda3cc133ddbadeb8817fb8 (cherry picked from commit abb8f7785ee24eac42f6d28dbfef37872a06c7e9) --- recovery.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'recovery.cpp') diff --git a/recovery.cpp b/recovery.cpp index a0c74524e..09b061d7d 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -862,9 +862,24 @@ prompt_and_wait(Device* device, int status) { break; case Device::MOUNT_SYSTEM: - if (ensure_path_mounted("/system") != -1) { - ui->Print("Mounted /system.\n"); + char system_root_image[PROPERTY_VALUE_MAX]; + property_get("ro.build.system_root_image", system_root_image, ""); + + // For a system image built with the root directory (i.e. + // system_root_image == "true"), we mount it to /system_root, and symlink /system + // to /system_root/system to make adb shell work (the symlink is created through + // the build system). + // Bug: 22855115 + if (strcmp(system_root_image, "true") == 0) { + if (ensure_path_mounted_at("/", "/system_root") != -1) { + ui->Print("Mounted /system.\n"); + } + } else { + if (ensure_path_mounted("/system") != -1) { + ui->Print("Mounted /system.\n"); + } } + break; } } -- cgit v1.2.3